You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "CONNER, BRENDAN (SBCSI)" <bc...@sbc.com> on 2005/08/29 21:03:52 UTC

Specifying a Standard Error Page

I've been experimenting how to specify a standard error page in the
web.xml file, following the example given in Core JavaServer Faces
(Chapter 12).  In one test, I intentionally cause a
NullPointerException.  I experience the following behavior, depending
upon how I configured my web.xml file:

If I specified the error page as follows:

	<error-page>
		<error-code>500</error-code>
		<location>/error.jsp</location>
	</error-page>

then everything worked as expected; my error page was displayed

However, if I specified the error page as follows:

	<error-page>
		<exception-type>java.lang.Throwable</exception-type>
		<location>/error.jsp</location>
	</error-page>

Then my error page did not get displayed, rather, the following line got
displayed:

	Error 500: Error calling action method of component with id
mainSubview:mainForm:_id20 

My question is: Why doesn't specifying <exception-type> of Throwable
capture all unhandled errors?

Is there a compact way to request that *all* unhandled errors go to
error.jsp?

- Brendan