Details
Description
JavaEE applications can specify a location for the container to redirect to when an exception is detected on the server. This is done in the web.xml using:
<error-page>
<exception-type>org.mycompany.myproduct.MyException</exception-type>
<location>error.html</location>
</error-page>>
However, this does not work when using JSF with Ajax. Any exceptions are propagated back to the client as part of the Ajax response so the container never sees them.
ICEfaces has a feature where you can specify a context parameter:
<context-param>
<param-name>org.icefaces.sessionExpiredRedirectURI</param-name>
<param-value>error.html</param-value>
</context-param>
However, this only applies to a single use case. If the exception is not specifically an org.icefaces.application.SessionExpiredException, nothing will happen. This can be a problem if a session expiry leads to a different exception. I recommend looking atICE-9224 for additional details about this issue.
This JIRA recommends that the current ICEfaces feature be expanded to allow developers to declare multiple exceptions and redirection locations - basically providing the same functionality as error-page declarations but that would work with Ajax responses.
<error-page>
<exception-type>org.mycompany.myproduct.MyException</exception-type>
<location>error.html</location>
</error-page>>
However, this does not work when using JSF with Ajax. Any exceptions are propagated back to the client as part of the Ajax response so the container never sees them.
ICEfaces has a feature where you can specify a context parameter:
<context-param>
<param-name>org.icefaces.sessionExpiredRedirectURI</param-name>
<param-value>error.html</param-value>
</context-param>
However, this only applies to a single use case. If the exception is not specifically an org.icefaces.application.SessionExpiredException, nothing will happen. This can be a problem if a session expiry leads to a different exception. I recommend looking at
This JIRA recommends that the current ICEfaces feature be expanded to allow developers to declare multiple exceptions and redirection locations - basically providing the same functionality as error-page declarations but that would work with Ajax responses.
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #41319 | Tue Jun 10 11:32:12 MDT 2014 | mircea.toma | |
Files Changed | ||||
MODIFY
/icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/util/EnvUtils.java
MODIFY /icefaces4/trunk/icefaces/core/src/main/resources/META-INF/faces-config.xml ADD /icefaces4/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/RedirectOnExceptionHandler.java |