Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-73282 Implement Portlet 3.0
  3. LPS-77391

Portlet 3.0 Action Parameters with the same name as a Public Render Parameter must contain both values

    Details

      Description

      The Portlet 3.0 Javadoc for BaseURL.setParameter(String, String) contains the following new requirement for the new javax.portlet.ActionURL subclass of javax.portlet.BaseURL:

      Action parameters (private parameters) are set as described. Public render parameters remain unchanged. If an action parameter has the same name as a public render parameter, both the action parameter value and the public render parameter value will be available during processing of the action request.

      This is technically a feature of Portlet 3.0 since the term "Action Parameters" refers to the new Portlet 3.0 ActionURL.getActionParameters() method.

      Even though it is technically a feature of Portlet 3.0, there is language in Section PLT.11.1.2 of the Portlet 2.0 Specification that gives further requirements:

      If a action or resource parameter has the same name as a public render parameter the public render parameter values must be the last entries in the parameter value array.

      Note that this text is not present in the Portlet 3.0 Specification, but that is by omission. For more information, see PLUTO-684.

      Steps to Reproduce.

      First, deploy the attached com.liferay.issue.lps77391.portlet.war artifact to $LIFERAY_HOME/deploy

      Next, follow the Steps 1-6 in the lps77391-foo portlet:

      Step 1: Click this RenderURL to set myPRP to [1, 2, 3]
      Step 2: Examine the value of myPRP above and ALSO in the lps77391-bar portlet and verify that the value in both places is [1, 2, 3]
      Step 3: Click this to submit a form via ActionURL
      Note: this step adds to parameters to the ActionURL before it is written as the value of the "action" attribute of the form:
      1) Sets value of myPRP = [x, y, z]
      (should cause [x, y, z] to be prepended to the existing value of [1, 2, 3])
      2) Sets value of _lps77391foo_WAR_comliferayissuelps77391portlet_myPRP = [a, b, c]
      (myPRP is prepended with the portlet namespace to indicate an "action parameter" like in Portlet 3.0)
      (should cause [a, b, c] to be prepended to [x, y, z, 1, 2, 3])
      Step 4: Examine the value of myPRP above and verify that the ACTION_PHASE value is [a, b, c, x, y, z, 1, 2, 3] and that the RENDER_PHASE value is [x, y, z]).
      Also examine the lps77391-bar portlet and verify that the value from the RENDER_PHASE is [x, y, z].

      Expected Results

      Steps 2 and 8 contain the correct values.

      Actual Results

      Step 4 contains a value of [x, y, z, 1, 2, 3] indicating that the [a, b, c] "action parameter" value was not prepended to [a, b, c, x, y, z, 1, 2, 3].

        Attachments

          Activity

            People

            • Assignee:
              brian.chan Brian Chan
              Reporter:
              neil.griffin Neil Griffin
              Recent user:
              Csaba Turcsan
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 42 weeks, 6 days ago

                Packages

                Version Package
                7.0.0 DXP FP39
                7.0.0 DXP SP7
                7.0.5 CE GA6
                7.0.X
                Master