Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.0-alpha
-
None
Description
MyFaces suffers from the problem described here:
https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1515
Apologies for the Mojarra reference.
In the MyFaces case, the problem exists in two places:
1. org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage
In particular, in renderView(), we do:
ResponseWriter origWriter = createResponseWriter(context);
StateWriter stateWriter = new StateWriter(origWriter, 1024); <-------- Here
try
{
ResponseWriter writer = origWriter.cloneWithWriter(stateWriter);
Instead of wrapping the StateWriter around the ResponseWriter (and then cloning that ResponseWriter with itself), we should be wrapping the StateWriter around the Writer returned by ExternalContext.getResponseOutputWriter().
2. org.apache.myfaces.view.facelets.FaceletViewHandler
Again, in renderView, we've got:
ResponseWriter origWriter = this.createResponseWriter(context);
// QUESTION: should we use bufferSize? Or, since the
// StateWriter usually only needs a small bit at the end,
// should we always use a much smaller size?
stateWriter = new StateWriter(origWriter, this.bufferSize != -1 ? this.bufferSize : 1024);
ResponseWriter writer = origWriter.cloneWithWriter(stateWriter);
So the same issue exists here.
FWIW, not sure whether FaceletViewHandler is still used - perhaps this is now obsolete?