JSF 1.2动作异常和actionListener之间的区别 [英] JSF 1.2 difference between exception in action and actionListener
问题描述
我注意到了JSF 1.2。在actionListener方法中抛出异常时,不返回错误页面,但在操作方法中抛出异常时返回错误页面。这是为什么?它可以在两种情况下返回错误页吗?
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?
推荐答案
FacesEvent
监听方法是静默的抓住并包裹在 AbortProcessingException
并登录到控制台。这只是按照规范。
Any exception which is thrown in a FacesEvent
listener method is silently caught and wrapped in a AbortProcessingException
and logged to the console. That's just as per the specification.
ActionEvent
监听器方法(与任何其他 FacesEvent一样
侦听器方法)对导航任务不承担任何责任。真正的行动方法有。通常,只有在您想要观察动作调用时才使用动作侦听器方法,而不是执行某些业务任务(这会影响响应)。
The ActionEvent
listener method (as any other FacesEvent
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).
这篇关于JSF 1.2动作异常和actionListener之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!