tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Voegele, Jason" <Jason.Voeg...@us.origin-it.com>
Subject RE: Request Parameters Getting Lost
Date Mon, 13 Nov 2000 15:22:54 GMT
I've discovered the problem with the request parameters.  When using the
web.xml file to identify a "welcome page" for a webapp, the file needs to be
explicitly identified in the URL.  I was failing to do this.  So, invoking a
JSP like this fails to send the parameters:
 
    http://localhost:8080/parmtest?parm1=val1
<http://localhost:8080/parmtest?parm1=val1&parm2=val2> &parm2=val2
 
However, if the JSP page is identified explicitly in the URL (instead of
automagically by the web.xml file) it works:
 
    http://localhost:8080/parmtest/listparm.jsp?parm1=val1
<http://localhost:8080/parmtest/listparm.jsp?parm1=val1&parm2=val2>
&parm2=val2
 
 
It also works if you don't explicitly mention the JSP file, but you do
provide the "/" after the directory name, like so:
 
    http://localhost:8080/parmtest/?parm1=val1
<http://localhost:8080/parmtest/?parm1=val1&parm2=val2> &parm2=val2
 
The form directly above is ALMOST identical to the original version I was
using, except for the extra "/" between the webapp name and the parameter
list.
 
Now, my only question is, is this the correct behavior, or a bug?
 
Thanks again,
Jason Voegele
 

-----Original Message-----
From: Voegele, Jason [mailto:Jason.Voegele@us.origin-it.com]
Sent: Monday, November 13, 2000 10:07 AM
To: tomcat-user@jakarta.apache.org
Subject: RE: Request Parameters Getting Lost


I'm still having difficulty obtaining the request parameters from the
implicit JSP request object.
 
I tried the JSP page listed below.  It worked fine when I put it in the
TOMCAT_HOME\webapps\root directory, however, if I put it in another
subdirectory or set up a context to point to another directory, it no longer
works.  Everything else works fine, but the request parameters just aren't
there.
 
For example, the JSP listed below works when placed in
TOMCAT_HOME\webapps\root and invoked as
http://localhost:8080/listparm.jsp?parm1=val1
<http://localhost:8080/listparm.jsp?parm1=val1&parm2=val2> &parm2=val2
 
However, I tried to place this JSP into TOMCAT_HOME\webapps\parmtest, and
then set up the web.xml file to make listparm.jsp the "welcome page", but
when I do that the request parameters get lost again.  The JSP page still
works properly, the the request parameters just aren't there.
 
Does anyone have any idea what's going on with this?
 
Thanks in advance for your help,
Jason Voegele
 

-----Original Message-----
From: CPC Livelink Admin [mailto:cpclvlnk@fitzpatrick.cc]
Sent: Friday, November 10, 2000 4:49 PM
To: tomcat-user@jakarta.apache.org; Jason.Voegele@us.origin-it.com
Subject: RE: Request Parameters Getting Lost


 
I don't know your problem, but how about giving this a try.  Here is a jsp I
just wrote which works on tomcat 3.1 and displays all the parameters I give
it - See if it works - No comments on my bad coding style(s).  I placed it
in webapps\root\listparm.jsp and then accessed it via
http://localhost:8080/listparm.jsp?func=foo
<http://localhost:8080/listparm.jsp?func=foo&bad=bar&a=b> &bad=bar&a=b
 
<%@ page language="java" %>
<HTML>
<HEAD>
  <TITLE>List Parameters</TITLE>
</HEAD>
<BODY>
<%
 
  java.util.Enumeration eNames = request.getParameterNames();
 
  while ( eNames.hasMoreElements() )
  {
    String strName = (String)eNames.nextElement();
%>
    <%= strName %> : <%= request.getParameter(strName).toString() %><BR>
<%
  }
%>
<BR>Parameters are above.
</BODY>
</HTML>


-----Original Message-----
From: Voegele, Jason [mailto:Jason.Voegele@us.origin-it.com]
Sent: Friday, November 10, 2000 04:27 PM
To: tomcat-user@jakarta.apache.org
Subject: RE: Request Parameters Getting Lost


Thanks for the pointer.  We're accessing the JSP with IE 5.5, which has an
option to send URLs as UTF-8.  I turned this option off, but alas the
request parameters are still not there.  Any further advice?
 
Thanks,
Jason Voegele
 

-----Original Message-----
From: Keith McNeill [mailto:mcneill@iconverse.com]
Sent: Friday, November 10, 2000 2:54 PM
To: tomcat-user@jakarta.apache.org
Cc: Jason.Voegele@us.origin-it.com
Subject: RE: Request Parameters Getting Lost


We've had the same problem dealing with wireless apps & WAP gateways.  Our
theory is that the request params are being sent in UTF-8 not ascii and
Tomcat can't deal with it.  We do not have any problems when using JRun or
Websphere.
 
Keith McNeill
mcneill@iconverse.com <mailto:mcneill@iconverse.com> 

-----Original Message-----
From: Voegele, Jason [mailto:Jason.Voegele@us.origin-it.com]
Sent: Friday, November 10, 2000 1:14 PM
To: 'tomcat-user@jakarta.apache.org'
Subject: RE: Request Parameters Getting Lost



My apologies, we're actually using request.getParameter("page_id"), as well
as the getParameterNames and getParameterValues as you've said.  I just
wrote the wrong method name in my original email.

Given that we are using the proper methods, is there any way to explain this
behavior? 

Thanks, 
Jason Voegele 


-----Original Message----- 
From: CPC Livelink Admin [ mailto:cpclvlnk@fitzpatrick.cc
<mailto:cpclvlnk@fitzpatrick.cc> ] 
Sent: Friday, November 10, 2000 12:37 PM 
To: tomcat-user@jakarta.apache.org 
Subject: RE: Request Parameters Getting Lost 



Actually, the functions are getParameterNames and getParameterValues 

-----Original Message----- 
From: Stefan Woithe [ mailto:stefan.woithe@net-linx.com
<mailto:stefan.woithe@net-linx.com> ] 
Sent: Friday, November 10, 2000 12:25 PM 
To: tomcat-user@jakarta.apache.org 
Subject: Re: Request Parameters Getting Lost 


Hi Jason, 

I use Tomcat 3.1final and in an JSP the implicit object "request". If you 
know the name of the parameter use request.getParameter(<name>). Where is 
the method "getRequestParameters()" located -- for sure not in 
javax.servlet.ServletRequest? 

Regards 

Stefan 

> "Voegele, Jason" wrote: 
> 
> We've run across some problems using request parameters in our JSP.  We 
decided to create a JSP that does nothing but print out request parms and 
values, just to ensure that they are being passed with the request. 
> 
> We invoke the JSP like so: 
http://localhost:8080/dwstatus?page_id=TEST_PAGE
<http://localhost:8080/dwstatus?page_id=TEST_PAGE>  
> 
> Our JSP simply prints out the value of the page_id parameter, and 
enumerates the names of all parameters sent. 
> 
> The value we get for the page_id parameter is always null.  There are no 
parameters present in the Enumeration returned by getRequestParameters(). 
> 
> Can anyone explain what's happening to our request parameters?  We're 
using Tomcat standalone on Windows NT Server 4.0. 
> 
> Thanks, 
> Jason Voegele 


Mime
View raw message