tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Saccoccio" <r...@chelsea.net>
Subject [PATCH] JspParseEventListener.java - Catch Throwable and throw new Exception
Date Sat, 25 Nov 2000 15:29:01 GMT

Would it be possible to change the generated _jspService() method to catch
Throwable instead of Exception?  JSP 1.2 is taking this direction (excerpt
and patch below).

Without breaking the existing JSP 1.1 implementation, the existing
catch(Exception) block in _jspService() can be modified to take a Throwable
or an additional catch(Throwable) block defined.  When a Throwable (that is
not an Exception) is caught, it can be wrapped with an
InvocationTargetException or TomcatException (or some other Throwable
wrapper Exception).  This allows PageContext.handlePageException(Exception)
to continue to be used IAW the 1.1 spec.

This is helpful for obvious reasons.  In our case, we had a RuntimeException
being thrown from a static initializer which was being caught by the
ClassLoader and thrown as a ExceptionInInitializerError.

--robs

--------------------------------------------------------------

Mime
View raw message