Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-2504

Request get parameters are included into the result URL even though the request is PortletRequest

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.0
    • 2.1.2
    • None
    • Struts 2.1.0, xwork 2.1.0, struts2-portlet-plugin-2.1.0. Custom portlal implementation.

    Description

      Request get parameters are included to the portlet url. Portlet specification says that only setParameter method should be used to add parameters while building portlet URLs.

      Consider org.apache.struts2.components.URL

      Let's compare the following methods:
      1. Struts 2.0.9 code:

      private void includeGetParameters() {
      if(!(Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()))

      { String query = extractQueryString(); mergeRequestParameters(value, parameters, UrlHelper.parseQueryString(query)); }

      }
      Pay attention, that parameters are not included in case of portlet request.

      2. Struts 2.1.0 code:

      private void includeGetParameters()

      { String query = extractQueryString(); mergeRequestParameters(value, parameters, UrlHelper.parseQueryString(query)); }

      The parameters are always included.

      Attachments

        Activity

          People

            nilsga Nils-Helge Garli
            vlimansky Vladimir Limansky
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: