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

DefaultUrlHelper.buildParametersString appends just ? if collection is empty

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 2.3.24
    • 6.1.1
    • Core Actions
    • None
    • 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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            lukaszlenart Lukasz Lenart
            perfnorm Jasper Rosenberg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h

                Slack

                  Issue deployment