Ingram Chen wrote:
The method

    public String[] getParameters(final String key) {
        return (String[])parameters.keySet().toArray();
    }

if i look at that code (and the code it overwrites)
then it looks like that is deliberate...
But i don't know why...

do not use argument 'key' and return all parameters. I guess it should be:

    public String[] getParameters(final String key) {
        return getHttpServletRequest().getParameterValues(key) ;
    }

that is how it is done in its super class...

While I debug this problem, I found that getParameterMap() in WebRequest:

    public Map getParameterMap() {
        final Map map = new HashMap();

for (final Enumeration enumeration = httpServletRequest.getParameterNames(); enumeration
                .hasMoreElements();) {
            final String name = (String)enumeration.nextElement();
            map.put(name, httpServletRequest.getParameter(name));
        }
        return map;
    }

this implementation assumes that each parameterName has "only one" parameter String. If there are multiple parameters for particular parameterName, only first one is used. The servlet 2.4 API also comes with the same method on ServletRequest <http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletRequest.html#getParameterMap%28%29> ,but
the map it returned is in String:String[] pair.

Does Wicket not allow multiple parameters for the same parameterName ?

it does for all input fields
those are not using the param map.
This map is mostly used for Bookmarkable pages (links)
so to make PageParameters. and you are right, there we are not supporting multiply values.. So if PageParameters suddenly has String[] in it. We should also look at PageParamters!

johan



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to