tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mott Leroy <>
Subject Re: Best practice for Capturing JSP Errors
Date Fri, 03 Feb 2006 16:18:33 GMT
Glen Mazza wrote:

>> And another is to define the error page in your web.xml:
>> <error-page>
>>      <error-code>500</error-code>
>>       <location>/myPage.jsp</location>
>> </error-page>
> I would save these for generic HTTP error codes, or generic Java 
> exceptions (NullPointerErrors, ClassCastExceptions, perhaps), things are 
> more likely the result of errors in coding than in user entry, and 
> something the user cannot really recover from.
> Also, the JSTL <c:catch var="..."/> action may be something to look at 
> here, to keep runtime/coding errors handled within the JSP pages, 
> without needing to forward to a generic error page.

Yeah, I am looking to handle all errors that aren't currently handled in 
code. Imagine you have 400 JSPs some of which occassionally throw 
Exceptions, but do not use try/catch blocks or the errorPage directive. 
That is my current situation. I am hoping there is a way to capture the 
exceptions being thrown without having to change all 400 or so pages.

Thanks -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message