myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1461884 - /myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
Date Wed, 27 Mar 2013 22:33:44 GMT
Author: lu4242
Date: Wed Mar 27 22:33:44 2013
New Revision: 1461884

URL: http://svn.apache.org/r1461884
Log:
MYFACES-3695 'Cannot set header. Response already committed.' on WebSphere Application Server
7 and 8 (do not write header if response was already committed)

Modified:
    myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java

Modified: myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java?rev=1461884&r1=1461883&r2=1461884&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
(original)
+++ myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
Wed Mar 27 22:33:44 2013
@@ -83,7 +83,7 @@ public class ResourceHandlerImpl extends
      */
     @JSFWebConfigParam(since="2.1.10, 2.0.16", defaultValue="2048", group="resources")
     public static final String INIT_PARAM_RESOURCE_BUFFER_SIZE = "org.apache.myfaces.RESOURCE_BUFFER_SIZE";
-    private static final int INIT_PARAM_RESOURCE_BUFFER_SIZE_DEFAULT = 2048;
+    public static final int INIT_PARAM_RESOURCE_BUFFER_SIZE_DEFAULT = 2048;
     
     private Boolean _allowSlashLibraryName;
     private int _resourceBufferSize = -1;
@@ -405,7 +405,10 @@ public class ResourceHandlerImpl extends
                 {
                     int count = pipeBytes(in, out, buffer);
                     //set the content lenght
-                    httpServletResponse.setContentLength(count);
+                    if (!httpServletResponse.isCommitted())
+                    {
+                        httpServletResponse.setContentLength(count);
+                    }
                 }
                 finally
                 {



Mime
View raw message