You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2008/12/29 23:17:44 UTC

[jira] Commented: (WICKET-1876) RequestUtils.decodeParameters(String, ValueMap) doesn't follow the Servlet spec

    [ https://issues.apache.org/jira/browse/WICKET-1876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659671#action_12659671 ] 

Martin Grigorov commented on WICKET-1876:
-----------------------------------------

Hi Juergen,

Thanks for looking into this !

Do you mind to change MockHttpServletRequest.setUrl(String) to use decodeUrlParameters() instead of decodeParameters(). Otherwise my tests fail will ClassCastException complaining that the values in the map are java.lang.String while it expects [java.lang.String.

> RequestUtils.decodeParameters(String, ValueMap) doesn't follow the Servlet spec
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-1876
>                 URL: https://issues.apache.org/jira/browse/WICKET-1876
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.4
>         Environment: Any
>            Reporter: Martin Grigorov
>            Assignee: Juergen Donnerstag
>             Fix For: 1.4-RC2
>
>         Attachments: WICKET-1876.patch.txt
>
>
> RequestUtils.decodeParameters(String, ValueMap) fills a (Value)Map with values of type java.lang.String while it
> has to fill values of type String[] because by Servlet API java.servlet.ServletRequest.getParameterValues(String) returns String[].
> How I get to this: 
> mockHttpServletRequest.setUrl("http://dummy.com?param1=value1") -> this calls RequestUtils.decodeParameters(queryString, parameters);
> Later when I do mockHttpServletRequest.getParameterMap() and iterate over it I expect the values to be of type String[].
> A trivial (and wrong) fix would be to put "new String[] {currentValue}" in the map. The proper fix is to collect all values per parameter name and create an array of them. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.