简体   繁体   中英

JSF 1.2 difference between exception in action and 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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM