Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2500

ResponseWriter clone should not include itself

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0-alpha
    • 2.0.0-beta-2
    • General
    • 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?

      Attachments

        1. myfaces-2500-cleaner.patch
          3 kB
          Andy Schwartz
        2. myfaces-2500.patch
          2 kB
          Andy Schwartz

        Activity

          People

            Unassigned Unassigned
            andy.schwartz Andy Schwartz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: