MyFaces Core
  1. MyFaces Core
  2. MYFACES-1753

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

    Details

    • 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:
      None

      Description

      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); }

      else

      { 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

          Activity

          Hide
          Leonardo Uribe added a comment -

          This issue was fixed as part of MYFACES-3117

          Show
          Leonardo Uribe added a comment - This issue was fixed as part of MYFACES-3117

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development