portletspec3
  1. portletspec3
  2. PORTLETSPEC3-25

Errata: Clarify when & how parameters are removed

    Details

      Description

      This issue was split off from "PORTLETSPEC3-8 Errata: Clarify inconsistencies regarding getting and setting parameters"

      1. Under which cases (if any) should setting a parameter to a value of null remove the parameter?
      2. In which cases are public render parameters removed?

        Activity

        Hide
        Neil Griffin added a comment -

        Please disregard my previous comment. I see the changes there now. Thanks Scott.

        Show
        Neil Griffin added a comment - Please disregard my previous comment. I see the changes there now. Thanks Scott.
        Hide
        Neil Griffin added a comment -
        Show
        Neil Griffin added a comment - @Scott: Have you pushed the JavaDoc updates to your origin? I'm not seeing them here: http://msnicklous.github.io/portletspec3/javax/portlet/BaseURL.html#setParameter(java.lang.String , java.lang.String) http://msnicklous.github.io/portletspec3/javax/portlet/StateAwareResponse.html#setRenderParameter(java.lang.String , java.lang.String)
        Hide
        msnicklous added a comment -

        reviewed on 20130730 and can be closed.

        Show
        msnicklous added a comment - reviewed on 20130730 and can be closed.
        Hide
        msnicklous added a comment -

        reworked apidocs for the set parameter methods on BaseURL and StateAwareResponse.

        Show
        msnicklous added a comment - reworked apidocs for the set parameter methods on BaseURL and StateAwareResponse.
        Hide
        Neil Griffin added a comment -

        +1 This would mean that with both Pluto and Liferay, calling StateAwareResponse.setRenderParameter("paramName", (String) null) should not cause IllegalArgumentException to be thrown, but rather that the parameter should be removed.

        Show
        Neil Griffin added a comment - +1 This would mean that with both Pluto and Liferay, calling StateAwareResponse.setRenderParameter("paramName", (String) null) should not cause IllegalArgumentException to be thrown, but rather that the parameter should be removed.
        Hide
        msnicklous added a comment -

        WebSphere works like Liferay does - a null string ("") is allowed.

        The Pluto behavior of removing a parameter by setting it to the null string is not described in the spec anywhere, while removing a parameter by setting it to null is described in the javadocs for StateAwareResponse.setRenderParameter(String name, String value).

        I believe that a null string ("") should be allowed as a valid parameter value, while setting a private parameter to null should remove the parameter.

        Public render parameters may be set through the setParameter and setRenderParameter calls, but they may not be removed by setting them to null. To remove a public render parameter, the removePublicRenderParameter method must be used.

        Show
        msnicklous added a comment - WebSphere works like Liferay does - a null string ("") is allowed. The Pluto behavior of removing a parameter by setting it to the null string is not described in the spec anywhere, while removing a parameter by setting it to null is described in the javadocs for StateAwareResponse.setRenderParameter(String name, String value). I believe that a null string ("") should be allowed as a valid parameter value, while setting a private parameter to null should remove the parameter. Public render parameters may be set through the setParameter and setRenderParameter calls, but they may not be removed by setting them to null. To remove a public render parameter, the removePublicRenderParameter method must be used.
        Hide
        Neil Griffin added a comment -

        I did some additional testing, and in both Pluto and Liferay, calling StateAwareResponse.setRenderParameter("publicRenderParameter", "") works, and actually REMOVES the public render parameter from the maps. I believe that this is the expectation that Julien had during our 14 May conference call.

        On Pluto, calling StateAwareResponse.setRenderParameter("privateRenderParameter", "") REMOVES the private render parameter from the maps.

        On Liferay, calling StateAwareResponse.setRenderParameter("privateRenderParameter", "") sets the underlying map value to new String[]

        {""}

        Also during our 14 May conference call, I mentioned that JSF has a web.xml context-param feature named javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL that permits empty string request parameter values.

        I don't think that any of the proposed changes would cause a problem. In general, we just need to make sure that we don't introduce incompatibilities with this JSF feature.

        Show
        Neil Griffin added a comment - I did some additional testing, and in both Pluto and Liferay, calling StateAwareResponse.setRenderParameter("publicRenderParameter", "") works, and actually REMOVES the public render parameter from the maps. I believe that this is the expectation that Julien had during our 14 May conference call. On Pluto, calling StateAwareResponse.setRenderParameter("privateRenderParameter", "") REMOVES the private render parameter from the maps. On Liferay, calling StateAwareResponse.setRenderParameter("privateRenderParameter", "") sets the underlying map value to new String[] {""} Also during our 14 May conference call, I mentioned that JSF has a web.xml context-param feature named javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL that permits empty string request parameter values. I don't think that any of the proposed changes would cause a problem. In general, we just need to make sure that we don't introduce incompatibilities with this JSF feature.
        Hide
        Neil Griffin added a comment -

        Under which cases (if any) should setting a parameter to a value of null remove the parameter?

        In both Pluto and Liferay, calling StateAwareResponse.setRenderParameter("paramName", (String) null) causes an IllegalArgumentException to be thrown, even though the JavaDocs for StateAwareResponse.setRenderParameter(String name, String value)

        So with these two portlet containers, the only way remove a private render parameter (from the request map) is to remove ALL of them by calling StateAwareResponse.setRenderParameters(Map) with an empty map.

        In which cases are public render parameters removed?

        In Pluto and Liferay, the only way to remove a public render parameter (from the request map) is by calling StateAwareResponse.removePublicRenderParameter(String) or by removing ALL public and private by calling StateAwareResponse.setRenderParameters(Map) with an empty map.

        Show
        Neil Griffin added a comment - Under which cases (if any) should setting a parameter to a value of null remove the parameter? In both Pluto and Liferay, calling StateAwareResponse.setRenderParameter("paramName", (String) null) causes an IllegalArgumentException to be thrown, even though the JavaDocs for StateAwareResponse.setRenderParameter(String name, String value) So with these two portlet containers, the only way remove a private render parameter (from the request map) is to remove ALL of them by calling StateAwareResponse.setRenderParameters(Map) with an empty map. In which cases are public render parameters removed? In Pluto and Liferay, the only way to remove a public render parameter (from the request map) is by calling StateAwareResponse.removePublicRenderParameter(String) or by removing ALL public and private by calling StateAwareResponse.setRenderParameters(Map) with an empty map.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: