Struts 2
  1. Struts 2
  2. WW-4224

Collection Parameters for RedirectResults

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.15.3
    • Fix Version/s: 2.3.20
    • Component/s: Core Actions
    • Labels:
      None
    • Flags:
      Patch

      Description

      In some applications I have actions with a list member. That may be filled e.g. via checkboxlist. As we use Redirect-After-Post I want all list-elements to be present in redirect URL.

      The framework provided ServletRedirectResult uses
      StrutsResultSupport.conditionalParse()
      which in turn uses
      TextParseUtil.translateVariables()
      to resolve variables present as parameter values of a redirect result.

      Those methods convert the found object into String. When a collection is found just toString() is invoked. That is not quite useful.

      I would like to duplicate the URL-parameter-name for each element in the found collection.

      Therefore I added new Methods (with javadoc and tests):

      • StrutsResultSupport.conditionalParseCollection()
      • TextParseUtil.translateVariablesCollection()
        and using them in ServletRedirectResult.

      URL building itself does already support collections as paramter values.

      The problem was just that TextParseUtil forced the collection found on ValueStack into a string.

        Issue Links

          Activity

          Christoph Nenning created issue -
          Christoph Nenning made changes -
          Field Original Value New Value
          Attachment redirect-with-collection-parameters.patch [ 12608921 ]
          Lukasz Lenart made changes -
          Fix Version/s 2.3.17 [ 12324780 ]
          Lukasz Lenart made changes -
          Assignee Lukasz Lenart [ lukaszlenart ]
          Lukasz Lenart made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Lukasz Lenart made changes -
          Fix Version/s 2.3.18 [ 12319176 ]
          Fix Version/s 2.3.17 [ 12324780 ]
          Lukasz Lenart made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Lukasz Lenart made changes -
          Link This issue breaks WW-4482 [ WW-4482 ]

            People

            • Assignee:
              Lukasz Lenart
              Reporter:
              Christoph Nenning
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development