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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to