[ 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

SourceForge.net
Bugs item #1262990, was opened at 2005-08-18 16:34
Message generated for change (Settings changed) made by agrebnev
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107322&aid=1262990&group_id=7322

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: Open
Resolution: None
>Priority: 9
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
org.mortbay.jetty.servlet.Dispatcher

the following code

                // merge query string
                String
oldQ=httpServletRequest.getQueryString();
                if (oldQ!=null && oldQ.length()>0)
                {
                    if (query==null)
                        query=oldQ;
                    else
                        query=query+"&"+oldQ;
                }

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

org.mortbay.jetty.servlet.Dispatcher$DispatcherRequest

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
performed.
     * @param name The entry key.
     * @return String value.
     */
    public String getString(Object name)

However in JavaDocs of

    public String getParameter(String name);

of class

javax.servlet.ServletRequest

we can read

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


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


----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107322&aid=1262990&group_id=7322


-------------------------------------------------------
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
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss