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

Namespaced ViewState and other parameters cannot be obtained via portletRequest.getParameter()

    Details

      Description

      Due to the changes made for JAVASERVERFACES-SPEC-PUBLIC-790, the java.faces.ViewState and javax.faces.ClientWindow parameters now include a JSF separator character (usually a colon ":") when submitted to the server. This may cause backwards compatibility issues when developers attempt to do something like what we do in the showcase ActionURLDemoPortlet:

      String viewState = actionRequest.getParameter(ResponseStateManager.VIEW_STATE_PARAM);
      
      if (viewState == null) {
      
          /* ... */
      

      If namespaced parameters are turned on (which will be the default in JSF 2.3 + Portlet 3.0), this code will never be able to retrieve the view state. This is because the code used to retrieve parameters first checks if it can obtain the value via the passed String (paramName). If not, it attempts to prepend the namespace to the string and retrieve the value (namespace + paramName). This will not work for the view state and client window params in JSF 2.3 (namespace + seperatorChar + paramName). We need to consider whether we'll fix this in the Bridge by implementing a portlet filter which obtains the value correctly, or consider leaving it as is (a minor breaking change).

        Issue Links

          Activity

          Hide
          kyle.stiemann Kyle Stiemann added a comment -

          If we decide to allow this minor breaking change, we should fix our demo code as part of this ticket.

          Show
          kyle.stiemann Kyle Stiemann added a comment - If we decide to allow this minor breaking change, we should fix our demo code as part of this ticket .
          Hide
          neil.griffin Neil Griffin added a comment -
          Show
          neil.griffin Neil Griffin added a comment - Partial fix applied in commits 0dece0853f1e7a81f807faa3ff437a94a5edf1e8 and e306ce79d3b3f73cac7c60c96c1cf6248e51bed3 .

            People

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

              Dates

              • Created:
                Updated:

                Development

                  Subcomponents