Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 15859 invoked by uid 500); 10 May 2001 16:55:50 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: tomcat-dev@jakarta.apache.org Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 15672 invoked by uid 1059); 10 May 2001 16:55:46 -0000 Date: Thu, 10 May 2001 09:55:46 -0700 (PDT) From: "Craig R. McClanahan" X-Sender: craigmcc@localhost To: tomcat-dev@jakarta.apache.org Subject: Re: request.getparamter doesn't return anything without an '=' (equals) in the query string In-Reply-To: <989492930.3afa76c2912b9@mail1.digitalcyclone.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: localhost 1.6.2 0/1000/N It's my belief that iPlanet is not parsing this correctly. The specification does not give details on the expected syntax, but it is interesting to note that the HttpUtils.parseQueryString() method requires name=value pairs in order to parse request parameters. The same format is used to parse data from the input stream on a POST request. If you just want the part of the request that follows the "?" character, and don't need it parsed to request parameters, you can simply call: String value = request.getQueryString(); instead. Craig McClanahan On Thu, 10 May 2001, Ray Pitmon wrote: > Hi, > > *I first posted this to users, but was suggested that I post it to dev*. > > I apologize if this has been talked about before. (I was surprised I couldn't > find anything in the archives.) > > When browsing a URL with a query string, Tomcat doesn't seem to recognize it > unless there's an '=' in it. (it returns a null if there's no '=') Actually, > Tomcat sees it, but it doesn't get passed to the servlet/jsp. > > We are using IPlanet 4.1 (without Tomcat), and it seems to work fine. When I > try it on Apache/Tomcat, it doesn't work (needs the '='). I personally don't > think it would be that much of a deal to change it, but there's a lot of code > already written. > > I am using java1.3, have tried tomcat 3.2.1 and 3.2.2b4 (ajp13 interface) > > Here's a jsp that shows an example: > > [root@web4]$ cat getparam.jsp > > > This page is looking for x
> <%= request.getParameter("x") %> > > > > -- > Here's what I get when I browse this URL: http://web.server.com/getparam.jsp?x > ----- > (IPlanet) > > This page is looking for x > ----- > (apache/tomcat) > > This page is looking for x > null > ----- > (notice the null returned from apache/tomcat) > > > Same URL with an '=' on the end: http://web.server.com/getparam.jsp?x= > ---- > (IPlanet) > > This page is looking for x > ---- > (apache/tomcat) > > This page is looking for x > --- > (no null!) > > > Here's part of my jasper.log(note after request params): > > (without the '=' in the URL) > 2001-05-10 05:07:34 - JspEngine --> /getparam.jsp > 2001-05-10 05:07:34 - ServletPath: /getparam.jsp > 2001-05-10 05:07:34 - PathInfo: null > 2001-05-10 05:07:34 - RealPath: /home/httpd/my-cast/getparam.jsp > 2001-05-10 05:07:34 - RequestURI: /getparam.jsp > 2001-05-10 05:07:34 - QueryString: x > 2001-05-10 05:07:34 - Request Params: > 2001-05-10 05:07:34 - Classpath according to the Servlet Engine is: .... > ------------ > (with the '=' in the URL) > 2001-05-10 05:08:28 - JspEngine --> /getparam.jsp > 2001-05-10 05:08:28 - ServletPath: /getparam.jsp > 2001-05-10 05:08:28 - PathInfo: null > 2001-05-10 05:08:28 - RealPath: /home/httpd/my-cast/getparam.jsp > 2001-05-10 05:08:28 - RequestURI: /getparam.jsp > 2001-05-10 05:08:28 - QueryString: x= > 2001-05-10 05:08:28 - Request Params: > 2001-05-10 05:08:28 - x = > 2001-05-10 05:08:28 - Classpath according to the Servlet Engine is: .... > > > Is my developer just not using request.getparameter right and IPlanet is broken > by functioning the way it does, or is Tomcat broken? Tomcat & IPlanet show > different results with the exact same code. > > > thanks for any help I can get... I would really like to get this working with > Apache/Tomcat. > > ---------------------- > Ray Pitmon > Digital Cyclone, Inc. > rp@digitalcyclone.com > > http://www.my-cast.com >