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

Response committed too early due to flush from StateWriter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.12
    • 2.2.13, 2.3.0
    • None
    • None

    Description

      We've found a problem where it seems that MyFaces is flushing output too early in the RENDER_RESPONSE PHASE. As a result the response is committed before we have a chance to handle an error in that phase.

      This is because the renderView method from FaceletViewDeclarationLanguage calls writer.endDocument() which ends up calling the flush() method from StateWriter. This commit behavior is different between 2.0 and 2.2. It looks like a flush() was empty on 2.0, and now a call was added, which causes the issue we are seeing.

      Here's a sample app:
      1) Drive a request: localhost:9080/StateWriter/index.xhtml
      2) You should be able to see in the logs that response was committed, so redirect to error.xhtml cannot be performed.

      Attachments

        1. StateWriter.war
          7 kB
          Eduardo Breijo
        2. server.log
          378 kB
          Dora Rajappan
        3. MYFACES-4125.patch
          1 kB
          Eduardo Breijo

        Activity

          People

            eduardobreijo Eduardo Breijo
            eduardobreijo Eduardo Breijo
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: