Hi, I have a servlet which dispatches out various jsp's. Some of the jsp's
resulting html contain links back to the servlet to fire off another page
like this:
A HREF="mainservlet?cmd=loadpage=home"HOME/A
When I do a request.getParameter("cmd") the string I get is "cmd" which is
right.
When I do
No you are not doing anything wrong. But I think you are using a name that is allready
reserved for a parameter. (Please correct me if I'm wrong)
Try changing page to page1 or something different and see the result.
Stefan
It looks like the "page" could be a key-word and is pulling
"mainservlet?cmd=load",try changing page to something like "pg" and see if u
get the same error.
Ram
From: Matt Becker [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: get
rote:
It looks like the "page" could be a key-word and is pulling
"mainservlet?cmd=load",try changing page to something like "pg" and see if
u get the same error.
Ram
From: Matt Becker [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: getPa
On Tuesday January 16, 2001 Matt Becker wrote:
Hi, Ram!
I tried changing the name "page" to "pg" but that didn't change that
getParameter() returns other part of the text that's not part of the "pg"
variable. I thought maybe I was doing something wrong with the URL in how
the parameters
PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: getParameter() help
Date: Tue, 16 Jan 2001 14:07:56 -0800
Hi, Ram!
I tried changing the name "page" to "pg" but that didn't change that
getParameter() returns other part of the text that's not part of
ng it right.Try restarting the server and close all browser
windows that are open(just to make sure that the browser is not dishing
out the cached page).Also please post your code so that we can take a look
at it.
hope this solves your problem
Ram
From: Matt Becker [EMAIL PROTECTED]
Reply-To: [
ubject: Re: getParameter() help
Date: Tue, 16 Jan 2001 14:45:22 -0800
Here's a boiled down version of my code.
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException
{
String cmd = request.getParameter("cmd"
I modded your code and made it a JSP so it was easy for me.
The following URLs work as expected. You will need to change /livelink/ms
to whatever webapp you use, I just put it in there cuz it was easy
http://localhost:8080/livelink/ms/foo.jsp
http://localhost:8080/livelink/ms/foo.jsp?cmd=load
Are you using Tomcat 3.2.1 as a standalone browser or in combination with apache or
similar browser??
I tried to check if home is a reservered word but it works fine with my setup (Tomcat
standalone, win2k, IE5.5)
Even page works without problem.
My suggestion is as RAmkumar said that
you try what Elijah suggested.I think elijah is right in pointing out
about the "home" word,probably the browser/server is substituting home
with the value u r getting.
Ram
From: Matt Becker [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: getParameter()
11 matches
Mail list logo