struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eirik Kj°lsrud" <wayb...@frisurf.no>
Subject Re: Handling ServletException
Date Fri, 06 Jun 2003 09:35:47 GMT
Thanks,

I'll set up an <error-page> element. I would like all reported errors to be
caught though, but it seems that the <error-page> element requires an
<error-code> element as well.

Does this mean that I have to add an <error-page> element for every
<error-code> I want to catch, or is there a way to tell teh container to
route every error to an error page ?

Best Regards
Eirik

"David Graham" <dgraham1980@hotmail.com> skrev i melding
news:Law15-F82QUXPXF2aZc0002a17e@hotmail.com...
> The Struts exception handling mechanism only handles exceptions thrown
from
> Action.execute() methods.  Your JSP is probably throwing an exception so
you
> need to setup <error-page> elements in web.xml to point to a friendlier
> error page.
>
> David
>
>
> >Hi.
> >
> >I've followed "everyone"s advice and written a custom Exception handler.
> >The
> >exceptionhandler is set up in struts-config to catch all exceptions :
> >
> ><!-- Global Exceptions -->
> >
> ><global-exceptions>
> >
> ><exception
> >
> >handler="mypackage.strutsextensions.CustomizedExceptionHandler"
> >
> >key="global.error.message"
> >
> >scope="request"
> >
> >type="java.lang.Exception"/>
> >
> ></global-exceptions>
> >
> >This works great, but my problem is that sometimes there occures a
> >SerlvetException which is just presented on screen and is not caught by
my
> >CustomizedExceptionHandler. I believe that this is because the
> >ServletException is thrown by the container ?? Anyhow, I would like to
> >catch
> >these exceptions as well, and preferably route them to my custom Error
> >handler.
> >
> >Does anyone have some advice on how to handle ServletExceptions to give
the
> >user better information ?
> >
> >Best Regards
> >
> >Eirik Kj°lsrud, Norway
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message