MyFaces Core
  1. MyFaces Core
  2. MYFACES-1753

Do not require to buffer the output with server-side-state-saving


    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.6, 2.1.0
    • Component/s: None
    • Labels:


      Attached you will find a patch against MyFaces 1.2.1 head which will eliminate the need to buffer the output to write in the ViewState hidden field when using Server-Side-State-Saving.

      With SSSS just a sequence number (previously jsf_sequence) will be written into the ViewState hidden field.
      This patch changes just this, and avoid the use of the StateAwareWriter. The restore process based on the jsf_sequence already worked, just minor restructuring to get the next sequence number early.

      When using Facelets, you'll also need a ViewHandler with the following content:

      public void renderView(FacesContext context, UIViewRoot uiRoot) throws IOException, FacesException

      { StateManager stateManager = context.getApplication().getStateManager(); original.renderView(context, uiRoot); stateManager.saveView(context); }

      public void writeState(FacesContext context) throws IOException
      StateManager stateManager = context.getApplication().getStateManager();
      if (stateManager.isSavingStateInClient(context))

      { original.writeState(context); }


      { stateManager.writeState(context, new Object[2]); }


      This disables the Facelets own state handling and ensures we save the view after rendering.

      1. no_buffer.diff
        19 kB
        Mario Ivankovits

        Issue Links


          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          1295d 4h 47m 1 Leonardo Uribe 14/May/11 01:31
          Leonardo Uribe made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          Assignee Mario Ivankovits [ imario ] Leonardo Uribe [ lu4242 ]
          Fix Version/s 2.0.6 [ 12316397 ]
          Fix Version/s 2.1.0 [ 12315190 ]
          Leonardo Uribe added a comment -

          This issue was fixed as part of MYFACES-3117

          Leonardo Uribe added a comment - This issue was fixed as part of MYFACES-3117
          Leonardo Uribe made changes -
          Link This issue relates to MYFACES-3117 [ MYFACES-3117 ]
          Mario Ivankovits made changes -
          Field Original Value New Value
          Attachment no_buffer.diff [ 12368517 ]
          Mario Ivankovits created issue -


            • Assignee:
              Leonardo Uribe
              Mario Ivankovits
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: