ResponseWriter clone should not include itself
----------------------------------------------

                 Key: MYFACES-2500
                 URL: https://issues.apache.org/jira/browse/MYFACES-2500
             Project: MyFaces Core
          Issue Type: Bug
          Components: General
    Affects Versions: 2.0.0-alpha
            Reporter: Andy Schwartz
            Priority: Minor


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?




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to