[ jetty-Bugs-1262990 ] Doubled query string and incorrect getParameter

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[ jetty-Bugs-1262990 ] Doubled query string and incorrect getParameter

Bugs item #1262990, was opened at 2005-08-18 12:34
Message generated for change (Settings changed) made by gregwilkins
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Servlets
Group: None
>Status: Closed
Resolution: Fixed
Priority: 7
Submitted By: Andrey Grebnev (agrebnev)
Assigned to: Greg Wilkins (gregwilkins)
Summary: Doubled query string and incorrect getParameter

Initial Comment:
I am trying to port my application AtLeap
(https://atleap.dev.java.net) under Jetty 5.1.4
AtLeap has already worked under Tomcat, Weblogic,
Websphere and Resin. However I confronted with some
difficulties in Jetty 5.1.4

When I call the request.getQueryString() I received as
result doubled query string (each parameter presents
two times). I found at line 247 in method

void dispatch(ServletRequest servletRequest,
ServletResponse servletResponse, int type)

of class

the following code

                // merge query string
                if (oldQ!=null && oldQ.length()>0)
                    if (query==null)

Where you can see that query string is really doubled.

But it is only one problem, there is another problem.

In line 495 of method

public String getParameter(String name)

of class


we can see the following code

            String value=_parameters.getString(name);

where  _parameters is a org.mortbay.util.MultiMap

    /** Get value as String.
     * Single valued items are converted to a String with
the toString()
     * Object method. Multi valued entries are converted
to a comma separated
     * List.  No quoting of commas within values is
     * @param name The entry key.
     * @return String value.
    public String getString(Object name)

However in JavaDocs of

    public String getParameter(String name);

of class


we can read

     * <p>If you use this method with a multivalued
     * parameter, the value returned is equal to the first
     * in the array returned by

In result we have that Jetty getParameter method is
inconsistent with Servlet 2.4 specification. We should
have the first value of multivalued instead comma-
separated list.

Any ideas?

Thanks beforehand.
Andrey Grebnev


Comment By: Greg Wilkins (gregwilkins)
Date: 2005-08-24 07:52

Logged In: YES

right you are!  The spec says dispatcher params replace
existing params and somehow I read that as merge.    The
merge code is removed from CVS now and there will be a
5.1.5rc1 shortly


You can respond by visiting:

This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
jetty-discuss mailing list
[hidden email]