如何在 Wicket 中进行异常处理
我读过,检票口不能抛出已检查的异常。怎么处理这个问题?在基于 Wicket spring 的应用程序中实现异常处理的好方法是什么?
苹果
I've read that wicket can't throw Checked exception. how to deal with this? What is a good way to implement exception handling in Wicket spring based application?
Mac
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你是什么意思,“检票口不能投球”? [需要引用] :)
也许您在某处读到 wicket 不会在默认配置中将异常传递给 servlet 容器?
我通常用
try
包装特定组件的方法,并在catch
中适当更改页面,即告诉用户出了问题。更新:
而且,在每个与反馈相关的组件中都有
error()
、warn()
等。请参阅此处。What do you mean, "Wicket can't throw". [citation needed] :)
Perhaps you read somewhere that wicket will not pass an exception to the servlet container in the default configuration?
I usually wrap specific components' methods with a
try
and change the page appropriately incatch
, i.e. telling the user that something went wrong.Update:
And also, you have the
error()
,warn()
etc. in everyComponent
which works with Feedback stuff. See here.