Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-2121

ChangeManager optimization - Apply ChangeManager customizations only during render response

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.1-core
    • 2.0.1-core
    • Facelets
    • None

    Description

      Here is the hook-point currently for applying the changes that the SessionChangeManager is holding on to:

      org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl.$ChangeApplyingVDLWrapper
      ...
      @Override
      public void buildView(FacesContext facesContext, UIViewRoot uiViewRoot)
      throws IOException

      { _wrapped.buildView(facesContext, uiViewRoot); ChangeManager cm = RequestContext.getCurrentInstance().getChangeManager(); cm.applyComponentChangesForCurrentView(FacesContext.getCurrentInstance()); }

      When the view root cache is turned off (org.apache.myfaces.trinidad.CACHE_VIEW_ROOT), which is a typical configuration when partial state saving is enabled, the above code ends up applying the customizations stored in the ChangeManager twice for the case of POST requests. The suggested improvement is to just apply this only during the RENDER_RESPONSE phase, which will optimally cover the new page request case and the postback case. Not only is this optimal, but also robust, because this ensures that the state is all restored, and the customizations can be safely applied just before rendering response.

      Attachments

        1. JIRA2121_Patch_over_trunk.patch
          1 kB
          Prakash Udupa

        Activity

          People

            gabrielle Gabrielle Crawford
            pudupa Prakash Udupa
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified