When I have javax.faces.application.ViewExpiredException I want to send user to login page.
web.xml
...
<context-param>
<param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
<param-value>true</param-value>
</context-param>
...
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/errors/sessionExpired.jsf</location>
</error-page>
sessionExpired.jsf
....
<c:redirect url="/index.jsf" />
but enableRestoreView11Compatibility is method that was used in JSF 1.1, what is solution for JSF 1.2?
com.sun.faces.enableRestoreView11Compatibility
is a JSF 1.2 setting that tells JSF 1.2 to behave like JSF 1.1.com.sun.faces.enableRestoreView11Compatibility
==true
means "do not throw aViewExpiredException
; instead, just create a new view if the old one has expired."The IBM notes on the JSF 1.1 behaviour say:
The default JSF 1.2 behaviour is defined in the spec as this:
To have a
ViewExpiredException
thrown when the view expires, remove thecom.sun.faces.enableRestoreView11Compatibility
parameter or set it tofalse
.The
com.sun
namespace suggests that the parameter is a Sun/Mojarra and derived implementation-specific setting, so it probably will not work with all JSF implementations.