tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <devli...@hanik.com>
Subject Bug 42409
Date Thu, 23 Oct 2008 05:58:58 GMT
Looking through the bug

https://issues.apache.org/bugzilla/show_bug.cgi?id=42409

I do believe that the author might correct in his assumption.
When we do a forward, in ApplicationDispatcher we call

        try {
            response.resetBuffer();
        } catch (IllegalStateException e) {
            throw e;
        }

according to the specification,

however, when the webapp calls 'sendError' we do a 
response.reset(code,msg), which clears all the headers.

the JavaDoc for sendError say
-------------------------
sendError(int)
public void sendError(int sc)
throws IOException
Sends an error response to the client using the specified status code 
and clearing
the buffer.
If the response has already been committed, this method throws an Illegal-
StateException. After using this method, the response should be considered
to be committed and should not be written to.
-------------------------


I believe the fix that is being suggest is correct,

any takers?

Index: java/org/apache/catalina/core/StandardHostValve.java
===================================================================
--- java/org/apache/catalina/core/StandardHostValve.java        
(revision 706079)
+++ java/org/apache/catalina/core/StandardHostValve.java        (working 
copy)
@@ -414,7 +414,7 @@
             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