You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tom Oellrich <to...@web.de> on 2000/04/18 16:46:32 UTC

Use of element

Hello,

I've just discovered the use of the <error-page> element in the deployment descriptor. This saves me from including the <%@ page errorPage %> directive in every single JSP page. Now, my question is: Can I also use this element to catch exceptions that are thrown inside my servlets? I don't seem to have been able to get this to work.

Many thanks in advance.
Tom


_______________________________________________________________________
1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de
IhrName@web.de, 8MB Speicher, Verschluesselung - http://freemail.web.de


Re: Use of element

Posted by "Bond - James D." <ja...@telesoft.com>.
> Hello,
> 
> I've just discovered the use of the <error-page> element in the deployment descriptor. This saves me from including the <%@ page errorPage %> directive in every single JSP page. Now, my question is: Can I also use this element to catch exceptions that are thrown inside my servlets? I don't seem to have been able to get this to work.
> 
> Many thanks in advance.
> Tom
> 

Not really, but the alternative that I came up with was to wrap my entire
doPost method in a 'try-catch' block and if I catch ANY exception I put it
in the session and redirect to a different error JSP that grabs the
exception out of the session and shows a pretty error message on the 
page (just like the errorpage does basically except the exception is
session scope in this case).

> 
> _______________________________________________________________________
> 1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de
> IhrName@web.de, 8MB Speicher, Verschluesselung - http://freemail.web.de
> 
> 
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
> 


James Dalrymple
Telesoft Corp.