tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Lubke <Ryan.Lu...@Sun.COM>
Subject [Patch][Tomcat 4/5] Small issue with ErrorDispatcherValve
Date Wed, 14 Aug 2002 03:09:50 GMT
Given the following:

web.xml with error-page entries for the following Exception types:

   - IllegalStateException
   - ServletException

If a Servlet generates a RuntimeException, it is wrapped by a
ServletException.  Since there is an entry for ServletException 
in the web.xml, the actual root cause (in this case, an
IllegalStateException) was never unwrapped, thus leading to unexpected

I made a simple modification to the logic so that if the throwable
passed to the ErrorDispatcherValve is a ServletException, it will
attempt to get the root cause.  If the root cause is null, then proceed
with the error page lookup with the ServletException as the throwable 
object, otherwise, use the root cause for the error page lookup.

I've tested this using my own tests as well as those that Watchdog 4.0
has for this area as well, and all seems OK.

If I missed something here, please let me know.  I'm struggling to stay
awake here :)


PS.  I've attached some very simple patches for some javadoc warnings I
noticed during the build process.

View raw message