users@javaserverfaces.java.net

Re: FacesServlet throwing ServletExceptions

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Sat, 03 May 2008 09:16:13 -0700

Kito D. Mann wrote:
>
> I noticed that when Mojarra throws a ViewExpiredException, that
> exception is wrapped by FacesServlet as a ServletException and
> re-thrown. Since FacesException is a RuntimeException, what’s the
> problem with actually letting the exception percolate up to the
> container so that we can use the standard Servlet error page mechanism
> for these exceptions?
>
If I recall correctly, the Faces spec requires this behavior. That said,
the error-page mechanism should still work (and does, I've tested it).
The servlet spec will, when processing error-page definitions, will
unwrap the servlet exception (only once) and attempt to match the
the definitions against the unwrapped value.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Kito D. Mann - Author, JavaServer Faces in Action
> http://www.virtua.com <http://www.virtua.com/> - JSF/Java EE
> consulting, training, and mentoring
> http://www.JSFCentral.com <http://www.jsfcentral.com/> - JavaServer
> Faces FAQ, news, and info
> phone: +1 203-653-2989
> fax: +1 203-653-2988
>