Jetspeed 2
  1. Jetspeed 2
  2. JS2-605

Query string parameters should not (by default) be provided to portlets to be compliant to JSR 168 spec requirements

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1-dev
    • Fix Version/s: 2.1-dev, 2.1
    • Component/s: Container
    • Labels:
      None

      Description

      Jetspeed currently provides query string parameters to all portlets on the page requested.
      When a portlet already has a request parameter with the same name, the values are provided as an array where the query string parameters take precedence.
      Example: with a query string parameter color=red and portlet parameter color=blue, the portlet will receive color=[red,blue].

      Although the JSR 168 specs (PLT.11) doesn't make it very explicit this shouldn't be allowed (and the TCK definitely doesn't validate it),
      the portlet 1.0 API javadoc for PortletRequest.getParameter(String) is explicit on this: "Only parameters targeted to the current portlet are accessible."

      But, existing installations of Jetspeed-2 might already depend on this "feature".
      I won't simply "fix" this by making Jetspeed-2 strict to the specs, but instead make this feature optional/configurable although by default it should be specs compliant.

      The solution will allow for three possible usages:
      a) strict - no query string parameters will be visible to portlets (default)
      b) portlet scoped parameters take precedence (like color=[blue,red] from the example above)
      c) query string parameters take precedence (like color=[red,blue] from the example above which is the current implementation)

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        112d 5h 7m 1 Ate Douma 21/Feb/07 02:49
        Resolved Resolved Reopened Reopened
        8h 56m 1 Ate Douma 21/Feb/07 11:46
        Reopened Reopened Closed Closed
        9m 52s 1 Ate Douma 21/Feb/07 11:56
        Closed Closed Reopened Reopened
        3d 8h 30m 1 Ate Douma 24/Feb/07 20:26
        Reopened Reopened Resolved Resolved
        2m 56s 1 Ate Douma 24/Feb/07 20:29
        Resolved Resolved Closed Closed
        1683d 1h 7m 1 Ate Douma 04/Oct/11 22:37
        Ate Douma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Ate Douma made changes -
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Resolved [ 5 ]
        Hide
        Ate Douma added a comment -

        Fix applied

        Show
        Ate Douma added a comment - Fix applied
        Ate Douma made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Hide
        Ate Douma added a comment -

        The new solution has a bug which causes query string parameters provided on RequestDispatcher.include paths to be "masked".
        After close review of the servlet and portlet spec again about both this and the portlet spec required to "hide" portal scope parameters from portlets, it has become clear
        the specs make it very difficult to be compliant with both rules.
        Turns out issue JS2-9 which I opened almost 3 years ago is very much related and the comments I provided then are still very much valid.

        But, I have solved it now once and for all, and with the fix I'll provide shortly Jetspeed-2 is fully Portlet TCK compliant

        Show
        Ate Douma added a comment - The new solution has a bug which causes query string parameters provided on RequestDispatcher.include paths to be "masked". After close review of the servlet and portlet spec again about both this and the portlet spec required to "hide" portal scope parameters from portlets, it has become clear the specs make it very difficult to be compliant with both rules. Turns out issue JS2-9 which I opened almost 3 years ago is very much related and the comments I provided then are still very much valid. But, I have solved it now once and for all, and with the fix I'll provide shortly Jetspeed-2 is fully Portlet TCK compliant
        Ate Douma made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Ate Douma added a comment -

        Fixed.
        For individual portlets the global settings can be overriden in jetspeed-portlet.xml like:

        <portlet>
        <portlet-name>LegacyPortlet</portlet-name>
        <js:metadata name="merge.portal.parameters.with.portlet.parameters">true</js:metadata>
        <js:metadata name="merge.portal.parameters.before.portlet.parameters">true</js:metadata>
        </portlet>

        Show
        Ate Douma added a comment - Fixed. For individual portlets the global settings can be overriden in jetspeed-portlet.xml like: <portlet> <portlet-name>LegacyPortlet</portlet-name> <js:metadata name="merge.portal.parameters.with.portlet.parameters">true</js:metadata> <js:metadata name="merge.portal.parameters.before.portlet.parameters">true</js:metadata> </portlet>
        Ate Douma made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Ate Douma added a comment -

        Currently Jetspeed itself (in j2-admin) has some portlets which still depend on the "old" behavior, so disabling this by default now breaks certain portlets.

        I'm going to extend this feature to support overriding the global settings for individual portlets with jetspeed-portlet.xml metadata.

        Show
        Ate Douma added a comment - Currently Jetspeed itself (in j2-admin) has some portlets which still depend on the "old" behavior, so disabling this by default now breaks certain portlets. I'm going to extend this feature to support overriding the global settings for individual portlets with jetspeed-portlet.xml metadata.
        Ate Douma made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Ate Douma added a comment -

        Implemented as described.

        The now default and JSR-168 compliant behavior can be modified in jetspeed.properties:

        1. Until version 2.1, Jetspeed merged portal request parameters with portlet specific
        2. parameters, effectively allowing "shared" parameters.
        3. This is not compliant with the JSR-168 PLT.11, so by default this is now disabled.
          #
        4. By setting merge.portal.parameters.with.portlet.parameters=true this feature can
        5. be "restored".
        6. In the situation of portal and portlet parameters with the same name, by default
        7. the portlet parameters will be provided first in the values array, but this too
        8. can be overridden by setting merge.portal.parameters.before.portlet.parameters=true
          #
        9. Setting both these properties to true will deliver the "old" pre-2.1 behavior.
          #----------------------------------------------------------------------------------
          merge.portal.parameters.with.portlet.parameters=false
          merge.portal.parameters.before.portlet.parameters=false
        Show
        Ate Douma added a comment - Implemented as described. The now default and JSR-168 compliant behavior can be modified in jetspeed.properties: Until version 2.1, Jetspeed merged portal request parameters with portlet specific parameters, effectively allowing "shared" parameters. This is not compliant with the JSR-168 PLT.11, so by default this is now disabled. # By setting merge.portal.parameters.with.portlet.parameters=true this feature can be "restored". In the situation of portal and portlet parameters with the same name, by default the portlet parameters will be provided first in the values array, but this too can be overridden by setting merge.portal.parameters.before.portlet.parameters=true # Setting both these properties to true will deliver the "old" pre-2.1 behavior. #---------------------------------------------------------------------------------- merge.portal.parameters.with.portlet.parameters=false merge.portal.parameters.before.portlet.parameters=false
        Ate Douma created issue -

          People

          • Assignee:
            Ate Douma
            Reporter:
            Ate Douma
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development