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

Allow String arrays/iterables to be passed as params to redirectAction result

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.15.1
    • Fix Version/s: 2.3.20
    • Component/s: Other
    • Labels:

      Description

      It would be really nice to be able to have a result like:

      <result type="redirectAction">
        <param name="actionName">doit</param>
        <param name=actionMessages>${actionMessages}</param>
      </result>
      

      Where actionMessages is the result of getActionMessages() from a ValidationAware action, and has more than one message.

      And have that generate a url like: http://myco.com/doit.action?actionMessages=Message+1&actionMessages=Message+2

      Rather than convert the result into the toString of the collection which then can't be interpreted by struts on the other end as a collection.

      Looking at ServletRedirectResult.doExecute(), it does use urlHelper.buildParametersString() which is array/iterable aware, so the trick would be to allow the parsing of the parameter value to be a String[] or Iterable<String> (and have the ParsedValueEvaluator run against the contents).

      We'd probably only want to support this functionality for the ServletActionRedirectResult even though it would have to be implemented at the ServletRedirectResult layer.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              perfnorm Jasper Rosenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: