tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <>
Subject RE: Where is the Exception object when <error-page> is used?
Date Thu, 17 Oct 2002 02:22:20 GMT
Jean wrote:
Here is an example:

<%@ page isErrorPage="true" %>
<% exception.printStackTrace(new; %>

Thanks, but the problem is that when the exception occurs and is handled by
the <error-page> tag in web.xml, (not by the <%@ page errorPage="..." %>
tag,) then the implicit 'exception' object is null.  (At least, it is in my
particular case, I have not done more experiments.)  From the JSP spec, I
can only find that the 'exception' object should be present in the session
under a particular attribute name when an error occurs on a page that has
the errorPage attribute.

I don't think I can use <%@ page errorPage="..." %> because I don't know
where it's going to go to on error-- that's why there are multiple
<error-page> tags in web.xml.

And yet, I thought I read somewhere that Tomcat would put the offending
exception object in [session?] scope under a particular attribute name...
but I can't find that again.  I haven't a clue where to look in the code
either, so if someone knows generally where the
exception->web.xml->error-page tag handling happens, I'd be happy to try to
figure it out myself.  

Wendy Smoak

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message