Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.1-core
-
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
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.