myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From embre...@apache.org
Subject svn commit: r1805806 - /myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseWriterImpl.java
Date Tue, 22 Aug 2017 18:51:35 GMT
Author: embreijo
Date: Tue Aug 22 18:51:35 2017
New Revision: 1805806

URL: http://svn.apache.org/viewvc?rev=1805806&view=rev
Log:
MYFACES-4125 Response committed too early due to flush from StateWriter

Modified:
    myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseWriterImpl.java

Modified: myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseWriterImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseWriterImpl.java?rev=1805806&r1=1805805&r2=1805806&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseWriterImpl.java
(original)
+++ myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseWriterImpl.java
Tue Aug 22 18:51:35 2017
@@ -34,6 +34,7 @@ import javax.faces.context.FacesContext;
 import javax.faces.context.ResponseWriter;
 import javax.faces.render.Renderer;
 
+import org.apache.myfaces.shared.config.MyfacesConfig;
 import org.apache.myfaces.shared.renderkit.ContentTypeUtils;
 import org.apache.myfaces.shared.renderkit.RendererUtils;
 import org.apache.myfaces.shared.renderkit.html.util.UnicodeEncoder;
@@ -303,7 +304,12 @@ public class HtmlResponseWriterImpl
 
     public void endDocument() throws IOException
     {
-        _currentWriter.flush();
+        MyfacesConfig myfacesConfig = MyfacesConfig.getCurrentInstance(
+            FacesContext.getCurrentInstance().getExternalContext());
+        if (myfacesConfig.isEarlyFlushEnabled())
+        {
+            _currentWriter.flush();
+        }
         _facesContext = null;
     }
 



Mime
View raw message