Java JSF - Redirect to an XHTML site when a ViewExpiredException occurs

If you want to redirect the user to a certain site of your JSF web app, then use the tag "error-page" in your "web.xml" file. Here an example where we redirect a user to the index.xhtml site, when a "ViewExpiredException" happens.


The user will not see an exception in his web browser. You can also use other exceptions as well.