Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-3089

Disable ACTION_PHASE -> ACTION_PHASE scope by default

    Details

      Description

      Legacy Feature Description

      Section 5.1.2 of the JSR 329 Specification titled "Managing Lifecycle State" defines the requirements for what it refers to as the "Bridge Request Scope" which is a scope that causes managed-beans with <managed-bean-scope>request</managed-bean-scope> to live longer than a single portlet request. Specifically, it causes managed-beans that are created in the ACTION_PHASE of the portlet lifecycle to stay in memory until a subsequent ACTION_PHASE. In addition, JSR 329 requires portlet event requests and resource requests to participate in this scope, so that they can gain access to managed-beans in the scope.

      Here is a simple illustration of the "Bridge Request Scope" duration:

      +------------+    +-----------+    +------------+    +--------------+    +------------+
      |ACTION_PHASE| -> |EVENT_PHASE| -> |RENDER_PHASE| -> |RESOURCE_PHASE| -> |ACTION_PHASE|
      +------------+    +-----------+    +------------+    +--------------+    +------------+
                         (zero or more                      (zero or more
                        event requests)                    resource requests)
      

      The purpose of this scope was to minimize the disruptive user experience of losing form data when multiple JSF portlets appear on the same page.

      Proposal

      With the addition of the <f:ajax/> feature in JSF 2.0 in the year 2010, the Ajax rich user interface has become the preferred/dominant way of minimizing the disruptive user experience. Therefore, this issue serves as a proposal for adding a required feature to the bridge that shortens the "Bridge Request Scope" by default:

      +------------+    +-----------+    +------------+
      |ACTION_PHASE| -> |EVENT_PHASE| -> |RENDER_PHASE|
      +------------+    +-----------+    +------------+
                         (zero or more
                        event requests)
      

      Legacy behavior could be enabled using the following context-param in WEB-INF/web.xml or init-param in portlet.xml:

      WEB-INF/web.xml
      <context-param>
          <param-name>javax.portlet.faces.BRIDGE_REQUEST_SCOPE_ACTION_ENABLED</param-name>
          <param-value>true</param-value>
      </context-param>
      

      In addition, this proposal includes adding a required feature to the bridge that makes it possible to keep the "Bridge Request Scope" enabled, but to disable "Ajax" resource resource requests from participating in the scope:

      WEB-INF/web.xml
      <context-param>
          <param-name>javax.portlet.faces.BRIDGE_REQUEST_SCOPE_ACTION_ENABLED</param-name>
          <param-value>true</param-value>
      </context-param>
      <context-param>
          <param-name>javax.portlet.faces.BRIDGE_REQUEST_SCOPE_AJAX_ENABLED</param-name>
          <param-value>false</param-value>
      </context-param>
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                bridge-impl-2.1.0
                facesbridge-tck-5.0.0
                facesbridge-spec-5.0.0
                bridge-impl-3.1.0
                bridge-impl-4.1.0
                bridge-impl-5.0.0