I\'m working on a JSF web application in which I need to bring up a \"Session Expired\" page if the view expires, but a general technical error page for all others. The app
As mentioned by BylusC, deployment descriptor must not contain any error-page handler that will catch ViewExpiredException (wrapped inside ServletException) instead of the correct one - error-page for ViewExpiredException.
Do not forget to verify that server's deployment descriptor (e.g. TomEE/conf/web.xml) does not contain java.lang.Throwable or java.lang.Exception error-page definitions. Because these two web.xml are basically merged.
Yes - application's web.xml has precedence over server's web.xml, but if application's web.xml contains
and server's web.xml for
then application context will contain merge of those two:
and ViewExpiredExcpetion error handling will not work correctly.