tomcat-dev mailing list archives

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

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

        try {
        } 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
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/
--- java/org/apache/catalina/core/        
(revision 706079)
+++ java/org/apache/catalina/core/        (working 
@@ -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:
For additional commands, e-mail:

View raw message