JSF 1.2 difference between exception in action and actionListener

社会主义新天地 提交于 2019-12-22 11:11:18

问题


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?


回答1:


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.

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).



来源:https://stackoverflow.com/questions/3888710/jsf-1-2-difference-between-exception-in-action-and-actionlistener

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!