craigmcc 01/05/10 11:28:36
Modified: catalina/src/share/org/apache/catalina/core
ApplicationFilterChain.java
Log:
[Servlet 2.3 PFD2, Section 9.9]
Correct exception handling behavior when a Filter or Servlet throws a
RuntimeException. Previously, this exception was getting wrapped in a
ServletException (with a root cause) before being passed to an error page.
Now, the runtime exception itself is passed.
Reported By: Stephen DiMilla <[EMAIL PROTECTED]>
Revision Changes Path
1.7 +15 -4
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationFilterChain.java
Index: ApplicationFilterChain.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationFilterChain.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ApplicationFilterChain.java 2001/04/07 23:48:35 1.6
+++ ApplicationFilterChain.java 2001/05/10 18:28:33 1.7
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationFilterChain.java,v
1.6 2001/04/07 23:48:35 craigmcc Exp $
- * $Revision: 1.6 $
- * $Date: 2001/04/07 23:48:35 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationFilterChain.java,v
1.7 2001/05/10 18:28:33 craigmcc Exp $
+ * $Revision: 1.7 $
+ * $Date: 2001/05/10 18:28:33 $
*
* ====================================================================
*
@@ -93,7 +93,7 @@
* method itself.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.6 $ $Date: 2001/04/07 23:48:35 $
+ * @version $Revision: 1.7 $ $Date: 2001/05/10 18:28:33 $
*/
final class ApplicationFilterChain implements FilterChain {
@@ -185,6 +185,8 @@
throw (ServletException) e;
else if (e instanceof IOException)
throw (IOException) e;
+ else if (e instanceof RuntimeException)
+ throw (RuntimeException) e;
else
throw new ServletException(e.getMessage(), e);
}
@@ -222,6 +224,11 @@
support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
filter);
throw e;
+ } catch (RuntimeException e) {
+ if (filter != null)
+ support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
+ filter);
+ throw e;
} catch (Throwable e) {
if (filter != null)
support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
@@ -263,6 +270,10 @@
servlet);
throw e;
} catch (ServletException e) {
+ support.fireInstanceEvent(InstanceEvent.AFTER_SERVICE_EVENT,
+ servlet);
+ throw e;
+ } catch (RuntimeException e) {
support.fireInstanceEvent(InstanceEvent.AFTER_SERVICE_EVENT,
servlet);
throw e;