tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r710063 - /tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java
Date Mon, 03 Nov 2008 14:28:17 GMT
Author: markt
Date: Mon Nov  3 06:28:17 2008
New Revision: 710063

URL: http://svn.apache.org/viewvc?rev=710063&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=42409
The spec says reset the buffer, therefore use the resetBuffer() method. This makes custom
and standard error handling consistent.

Modified:
    tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java?rev=710063&r1=710062&r2=710063&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java Mon Nov  3 06:28:17
2008
@@ -368,7 +368,7 @@
 
         if (exception == null)
             return (null);
-        Class clazz = exception.getClass();
+        Class<?> clazz = exception.getClass();
         String name = clazz.getName();
         while (!Object.class.equals(clazz)) {
             ErrorPage errorPage = context.findErrorPage(name);
@@ -405,16 +405,8 @@
         request.setPathInfo(errorPage.getLocation());
 
         try {
-
-            // Reset the response if possible (else IllegalStateException)
-            //hres.reset();
             // Reset the response (keeping the real error code and message)
-            Integer statusCodeObj =
-                (Integer) request.getAttribute(Globals.STATUS_CODE_ATTR);
-            int statusCode = statusCodeObj.intValue();
-            String message =
-                (String) request.getAttribute(Globals.ERROR_MESSAGE_ATTR);
-            response.reset(statusCode, message);
+            response.resetBuffer();
 
             // Forward control to the specified location
             ServletContext servletContext =



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message