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

[jira] Resolved: (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:all-tabpanel ]

Juergen Donnerstag resolved WICKET-1876.
----------------------------------------

       Resolution: Invalid
    Fix Version/s: 1.4-RC2
         Assignee: Juergen Donnerstag

ServletRequest provides two related methods: String getParameter(String) and String[] getParameterValues(String). Since PageParameters implements ValueMap the respective methods are String getString(String) and String[] params.getStringArray(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.