struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jasper Rosenberg (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (WW-4514) DefaultUrlHelper.buildParametersString appends just ? if collection is empty
Date Fri, 12 Jun 2015 13:35:00 GMT

     [ https://issues.apache.org/jira/browse/WW-4514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jasper Rosenberg updated WW-4514:
---------------------------------
    Attachment: DefaultUrlHelper.patch

Patch with suggested fix.

> DefaultUrlHelper.buildParametersString appends just ? if collection is empty
> ----------------------------------------------------------------------------
>
>                 Key: WW-4514
>                 URL: https://issues.apache.org/jira/browse/WW-4514
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.3.24
>            Reporter: Jasper Rosenberg
>            Priority: Trivial
>         Attachments: DefaultUrlHelper.patch
>
>
> 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)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message