Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=41709
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 22 Jul 2011 18:09:54 +0000 (18:09 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 22 Jul 2011 18:09:54 +0000 (18:09 +0000)
Provide exception messages for ISEs when response is already committed

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1149678 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/connector/LocalStrings.properties
java/org/apache/catalina/connector/ResponseFacade.java
webapps/docs/changelog.xml

index 1449a44..034d9b0 100644 (file)
@@ -44,6 +44,7 @@ coyoteAdapter.accesslogFail=Exception while attempting to add an entry to the ac
 #
 coyoteResponse.getOutputStream.ise=getWriter() has already been called for this response
 coyoteResponse.getWriter.ise=getOutputStream() has already been called for this response
+coyoteResponse.reset.ise=Cannot call reset() after response has been committed
 coyoteResponse.resetBuffer.ise=Cannot reset buffer after response has been committed
 coyoteResponse.sendError.ise=Cannot call sendError() after the response has been committed
 coyoteResponse.sendRedirect.ise=Cannot call sendRedirect() after the response has been committed
index 0f5d794..13a7c04 100644 (file)
@@ -250,7 +250,7 @@ public class ResponseFacade
 
         if (isCommitted())
             throw new IllegalStateException
-                (/*sm.getString("responseBase.reset.ise")*/);
+                (sm.getString("coyoteResponse.setBufferSize.ise"));
 
         response.setBufferSize(size);
 
@@ -311,7 +311,7 @@ public class ResponseFacade
 
         if (isCommitted())
             throw new IllegalStateException
-                (/*sm.getString("responseBase.reset.ise")*/);
+                (sm.getString("coyoteResponse.resetBuffer.ise"));
 
         response.resetBuffer();
 
@@ -335,7 +335,7 @@ public class ResponseFacade
 
         if (isCommitted())
             throw new IllegalStateException
-                (/*sm.getString("responseBase.reset.ise")*/);
+                (sm.getString("coyoteResponse.reset.ise"));
 
         response.reset();
 
@@ -441,7 +441,7 @@ public class ResponseFacade
 
         if (isCommitted())
             throw new IllegalStateException
-                (/*sm.getString("responseBase.reset.ise")*/);
+                (sm.getString("coyoteResponse.sendError.ise"));
 
         response.setAppCommitted(true);
 
@@ -456,7 +456,7 @@ public class ResponseFacade
 
         if (isCommitted())
             throw new IllegalStateException
-                (/*sm.getString("responseBase.reset.ise")*/);
+                (sm.getString("coyoteResponse.sendError.ise"));
 
         response.setAppCommitted(true);
 
@@ -471,7 +471,7 @@ public class ResponseFacade
 
         if (isCommitted())
             throw new IllegalStateException
-                (/*sm.getString("responseBase.reset.ise")*/);
+                (sm.getString("coyoteResponse.sendRedirect.ise"));
 
         response.setAppCommitted(true);
 
index e3b52df..8cac95d 100644 (file)
         ignored when scanning jars for tag libraries. (kkolinko)
       </fix>
       <fix>
+        <bug>41709</bug>: Provide exception messages where no message is
+        provided currently for IllegalStateExcpetions triggered by calling
+        HttpServletResponse methods when the reponse is committed. (markt)
+      </fix>
+      <fix>
         <bug>51509</bug>: Fix potential concurrency issue in CSRF prevention
         filter that may lead to some requests failing that should not. (markt)
       </fix>