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

[perf] call markInitialState() inside vdl.retargetAttachedObjects() and vdl.retargetMethodExpressions()

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.14, 2.1.8
    • Component/s: JSR-314
    • Labels:
      None

      Description

      To ensure compatibility with the RI, In JSF 2.1, markInitialState() call is done after the component tree is built with a visitTree() call. That works fine, but in JSF 2.0 or when you have a dynamic content inside a page, it is necessary to activate markInitialState() call through facelet algorithm as described in MYFACES-3451.

      The concept works very good, but I notice a side effect in vdl.retargetAttachedObjects() and vdl.retargetMethodExpressions(). Since markInitialState() call goes from leaf to the root, and these methods traverse the tree to apply changes in child components, all changes done by these two methods are stored into the "delta" part of the state.

      Since vdl.retargetAttachedObjects() and vdl.retargetMethodExpressions() are called in build view time and only when the composite component is created, it is safe to check if pss is used in the view and markInitialState() algorithm has been activated, to call markInitialState() over the child components (the call for the top level component is done in the outside). Maybe it will be some extra calls to markInitialState() for the same component, but it is worth to do it, because this call is very fast, and the effect is get a zero (or almost zero) state size overhead for composite components.

      Additionally, it is better in this case to use these classes:

      org.apache.myfaces.view.facelets.tag.jsf.PartialMethodExpressionActionListener;
      org.apache.myfaces.view.facelets.tag.jsf.PartialMethodExpressionValidator;
      org.apache.myfaces.view.facelets.tag.jsf.PartialMethodExpressionValueChangeListener;

      to ensure no state is stored in these cases. Note this issue is the solution to the problem described in MYFACES-3551

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lu4242 Leonardo Uribe
                Reporter:
                lu4242 Leonardo Uribe
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: