tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mott Leroy <m...@acadaca.com>
Subject jasper exception and root cause
Date Fri, 03 Feb 2006 21:59:48 GMT
Sorry, there was a thread about jsp errors, but i thought this was 
different enough to warrant a new thread.

I'm having trouble programatically retrieving the root cause of a JSP 
Exception. Basically, if a NullPointerException is thrown on a JSP page, 
I want to know that this exception was thrown and report it. I defined 
an error page in my web.xml:

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

Then I created the error.jsp page, with <%@ page isErrorPage="true" %>

Now, however, when i purposefully throw a NullPointerException from 
another page, my error.jsp seems unable to programatically access this 
stack trace.

The "exception" implicit variable on this page is a "JasperException", 
which surprises me because the JSP 2.0 Spec (1.4.3) says that the 
exception should be of type javax.servlet.error.exception or 
javax.servlet.jsp.jspException. Doesn't seem like either is the case.

The JasperException's stack trace isn't useful to report and there 
doesn't seem to be a "getRootCause" method on a JasperException like 
there is for a JspException.

How can I retrieve the root cause?

The default 500 error page provided by Tomcat prints out both the 
JasperException as well as the root cause, so it seems like this should 
be possible.

Any help is much appreciated. Thanks.

- Mott

[tomcat 5.0.28]

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message