portletspec3
  1. portletspec3
  2. PORTLETSPEC3-32

Change the parameter handling on the action URL to match the parameter handling on the render URL

    Details

      Description

      This addresses the differences in parameter handling on URLs created through the MimeResponse createActionURL() and createRenderURL() methods. It would be logical for the behavior to be the same for both URL types, since both are represented by a PortletURL object. Currently, the parameter handling differs in only one area - the handling of public render parameters.

      A public render parameter can be set on a render URL. When the render URL is activated, the public render parameter is set to the new value, so the code in the render request will behave as follows:

      // returns the public render parameter as set on the render URL (or the first value of a multi-valued parameter)
      String value = renderRequest.getParameter("myPublicRenderParameter");    
      
      // returns an array containing the value or values of the public render parameter as set on the render URL
      String[] values = renderRequest.getParameterValues("myPublicRenderParameter");
      
      // returns the current value of the public render parameter as set on the render URL
      Map<String, String[]> parms = renderRequest.getPublicParameterMap();
      

      However, when a parameter with the same name as a public render parameter is set on an action URL, an action parameter by that name is set on the URL. During action request processing, BOTH the action parameter value AND the public render parameter value are available under the same parameter name, so the code in the action request will behave as follows:

      // returns the action parameter (or the first value of a multi-valued parameter)
      String value = actionRequest.getParameter("myPublicRenderParameter");    
      
      // returns an array containing the value or values of the action parameter followed by the value or values of the public render parameter
      String[] values = actionRequest.getParameterValues("myPublicRenderParameter");
      
      // will return the current value of the public render parameter (which may have been set in the past by this or another portlet,
      // or which may have been removed)
      Map<String, String[]> parms = actionRequest.getPublicParameterMap();
      

      From the point of view of the getParameter() and getParameterValues() methods, the action URL parameter handling behavior is confusing. It seems that there might not be many use cases that would count on this behavior. In fact, a negative use case might be more common - the programmer sets a parameter on an action URL, believing that a public render parameter is being set. But in reality, the actual public render parameter ever gets set.

      The proposal calls for making action URL behavior in this area to be identical to the render URL behavior.

      However, it would represent a change in specified behavior as compared to JSR 286, so it needs to be considered carefully.

        Activity

        No work has yet been logged on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: