JSF 1.2 Action 和 ActionListener 中的异常之间的区别
我注意到 JSF 1.2。当actionListener方法中抛出异常时不返回错误页面,但当action方法中抛出异常时返回错误页面。这是为什么?在这两种情况下它都能返回错误页面吗?
I've noticed that JSF 1.2. does not return error page when an exception was thrown in actionListener method but does return error page when an exception was thrown in action method. Why is that? Can it return error page in both cases?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
FacesEvent
侦听器方法被静默捕获并包装在
AbortProcessingException
并记录到控制台。这正是按照规范。ActionEvent
侦听器方法(与任何其他FacesEvent
侦听器方法一样)不负责导航任务。真正的行动方法有。一般来说,只有当您想要观察操作调用时才应使用操作侦听器方法,而不是执行某些业务任务(这会影响响应)。Any exception which is thrown in a
FacesEvent
listener method is silently caught and wrapped in aAbortProcessingException
and logged to the console. That's just as per the specification.The
ActionEvent
listener method (as any otherFacesEvent
listener method) has no responsibility for navigational tasks. The real action method has. Generally, the action listener method should only be used whenever you want to observe an action invoke, not to execute some business task (which affects the response).