[ http://mc4j.org/jira/browse/STS-385?page=comments#action_10720 ] 
            
Ben Gunter commented on STS-385:
--------------------------------

This can be easily fixed by changing addParameters(Map<String,Object>) to 
addParameters(Map<String,? extends Object>) and changing the parameter map 
likewise. I just tried it and it allows for passing in a Map<String,String[]> 
while not breaking anything else.

> Mismatch in request.getParameterMap and OnwardResolution.addParameters
> ----------------------------------------------------------------------
>
>                 Key: STS-385
>                 URL: http://mc4j.org/jira/browse/STS-385
>             Project: Stripes
>          Issue Type: Improvement
>          Components: ActionBean Dispatching
>            Reporter: Jasper Fontaine
>         Assigned To: Tim Fennell
>            Priority: Trivial
>
> There seems to be a mismatch in HttpRequest.getParameterMap and 
> OnwardResolution.addParameters.
> The first returns a Map<String, String[]>, the latter expects a Map<String, 
> Object>, which makes it a bit too contrived when trying to get them to work 
> together.
> Right now, since a Map<String, String[]> cannot be cast to a Map<String, 
> Object>, we have to loop over the String-String[] map and call 
> resolution.addParameter(String, Object) for each entry, or create a 
> String-Object map myself by looping and implicitly casting the String[] value.
> Example usecase: after a form post, get the String-String[] map from the 
> request via getContext().getRequest().getParameterMap() . Then save the form 
> and its 1-N form-parameters in the DB. When loading this 'form-template' is 
> retrieve  the data, and convert it back to a String-String[] map. I create a 
> redirect to the form jsp, and add the parameters.
> Proposed fix: 
> A- add a getParameterMap method to the ActionBeanContext, returning a 
> String-Object map. This would then mirror the addParameters method in 
> OnwardResolution. This would correctly keep the httprequest hidden for 
> unittesting purposes.
> B- add a addParameters(Map<String, String[]> method to OnwardResolution.

-- 
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

Reply via email to