struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <>
Subject Re: Getting at exceptions in Action Classes whenforwardedfromweb.xml?
Date Tue, 04 Oct 2005 00:03:30 GMT
On 10/3/05, Adam Hardy <> wrote:
> Oh I see, sorry.
> That would be a tomcat thing. I have a suspicion that there may never be
> an exception. Tomcat (or your appserver) is just creating an error -
> that doesn't mean that it actually threw a Java exception.

That's not completely true. Or, more properly, the servlet container *must*
forward information about an exception it catches (from the servlet) in well
known request attributes as described in Section SRV.9.9 of the servlet
spec. In particular, the following request attributes get exposed:

* java.servlet.error.status_code (java.lang.Integer)

* java.servlet.error.exception_type (java.lang.Class)

* java.servlet.error.message (java.lang.String)

* java.servlet.error.exception (java.lang.Throwable) -- Servlet 2.3 or later

* java.servlet.error.request_uri (java.lang.String)

* java.servlet.error.servlet_name (java.lang.String)

In short, if your error handling servlet is invoked, it may rely on request
attributes with these names to gain access to information about the error
that occurred.


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