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

DefaultUrlHelper.buildParametersString appends just ? if collection is empty

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 2.3.24
    • Fix Version/s: 2.5.x
    • Component/s: Core Actions
    • Labels:
      None
    • Flags:
      Patch

      Description

      DefaultUrlHelper.buildParametersString() checks that it has parameters to append before adding the first "?"/"&", but if the only parameters are empty Iterables/Arrays, then it shouldn't do that.

      I'd suggest adding the new query string to a StringBuilder, and then if it is non-empty, append that with the separator to the link at the end. (See patch)

        Attachments

        1. DefaultUrlHelper.patch
          6 kB
          Jasper Rosenberg

          Activity

            People

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

              Dates

              • Created:
                Updated: