[ http://mc4j.org/jira/browse/STS-386?page=comments#action_10721 ]
Tim Fennell commented on STS-386:
---------------------------------
Sent this to the users mailing list, but adding it here to make sure it's
connected with the bug:
I think the solution to this is actually much simpler that anyone realizes ;)
We should just be able to change the signature from:
addParameters(Map<String,Object> params)
to
addParameters(Map<String,? extends Object> params)
While OnwardResolution is fairly naive in how it handles the parameters it is
saved by the fact that UrlBuilder is much smarter. When adding parameters to a
URL it inspects each and every parameter and looks to see if it is an array or
collection, and if so, loops over each value and recurses. As such it can
handle arbitrarily nested arrays and collections of objects. This turned out
to be much easier and simpler to do than to try and track everywhere else when
arrays and collections were being passed around.
> OnwardResolution.addParameter(String,Object[]) does not handle arrays and
> collections correctly
> -----------------------------------------------------------------------------------------------
>
> Key: STS-386
> URL: http://mc4j.org/jira/browse/STS-386
> Project: Stripes
> Issue Type: Bug
> Components: ActionBean Dispatching
> Affects Versions: Release 1.4.3
> Reporter: Ben Gunter
> Assigned To: Ben Gunter
> Priority: Minor
> Fix For: Release 1.5
>
>
> Currently, OnwardResolution.addParameter does this:
> if (this.parameters.containsKey(name)) {
> this.parameters.put(name, new Object[]
> {this.parameters.get(name), values});
> }
> else {
> this.parameters.put(name, values);
> }
> Which results in nested arrays of objects if called repeatedly with the same
> parameter name. Instead, it needs to check for arrays and collections and
> concatenate them properly.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://mc4j.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development