RE: getParameter() help

2001-01-16 Thread Stefan Langer

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




Re: getParameter() help

2001-01-16 Thread Ramkumar Manoharan

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: getParameter() help
Date: Tue, 16 Jan 2001 12:50:28 -0800

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 request.getParameter("page") the string I get is
"mainservlet?cmd=load" which is not right.
Does anyone know if I'm doing something wrong with how I'm writing the link
back to the servlet?
Thanks!

Matt Becker




Mythicwave Productions, Inc.
21053 Devonshire, #201
Chatsworth, Ca. 91311
818-700-1998
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


_
Get your FREE download of MSN Explorer at http://explorer.msn.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: getParameter() help

2001-01-16 Thread Matt Becker

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 were being passed in the GET that's being executed when the 
URL is clicked on. The first parameter "load" is always correct.

The separation between values passed is the "" symbol, right?

I'm using Tomcat 3.2.1, JDK 1.3, and IE 5.5 on a Win98 machine.

Thanks!

Matt


At 01:58 PM 1/16/01, you wrote:
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: getParameter() help
Date: Tue, 16 Jan 2001 12:50:28 -0800

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 request.getParameter("page") the string I get is
"mainservlet?cmd=load" which is not right.
Does anyone know if I'm doing something wrong with how I'm writing the link
back to the servlet?
Thanks!

Matt Becker




Mythicwave Productions, Inc.
21053 Devonshire, #201
Chatsworth, Ca. 91311
818-700-1998
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

_
Get your FREE download of MSN Explorer at http://explorer.msn.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: getParameter() help

2001-01-16 Thread Elijah Roberts

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 were being passed in the GET that's being executed when the 
 URL is clicked on. The first parameter "load" is always correct.
 
 The separation between values passed is the "" symbol, right?

Yes, that is right. Try changing the "home" to something else, like
"test". You are just hard coding "home" right, not using a JSP tag or
something? Also, when you hold the cursor over the link in IE what does
it say in the status bar? Is the link correct there and also is it
correct in the address bar after you click on the link?

Elijah Roberts
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: getParameter() help

2001-01-16 Thread Ramkumar Manoharan


Matt,

You are doing 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: [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 the "pg"
variable. I thought maybe I was doing something wrong with the URL in how
the parameters were being passed in the GET that's being executed when the
URL is clicked on. The first parameter "load" is always correct.

The separation between values passed is the "" symbol, right?

I'm using Tomcat 3.2.1, JDK 1.3, and IE 5.5 on a Win98 machine.

Thanks!

Matt


At 01:58 PM 1/16/01, you wrote:
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: getParameter() help
Date: Tue, 16 Jan 2001 12:50:28 -0800

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 request.getParameter("page") the string I get is
"mainservlet?cmd=load" which is not right.
Does anyone know if I'm doing something wrong with how I'm writing the 
link
back to the servlet?
Thanks!

Matt Becker




Mythicwave Productions, Inc.
21053 Devonshire, #201
Chatsworth, Ca. 91311
818-700-1998
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

_
Get your FREE download of MSN Explorer at http://explorer.msn.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


_
Get your FREE download of MSN Explorer at http://explorer.msn.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: getParameter() help

2001-01-16 Thread Matt Becker

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");

 if (cmd == null || cmd.equals(""))
 {
 ExportHTML(request, response, filePath + "default.htm");
 }
 else if (cmd.equals("load"))
 {
 String pgName = request.getParameter("pg");

 if (pgName == null || pgName.equals(""))
 {
 System.out.println("page is missing or empty!!!");
 }
 else
 {
 System.out.println("Outputing page: " + pgName);
 ExportHTML(request, response, filePath + pgName + 
".htm");
 }
 }
 else if (cmd.equals("search"))
 {
 }
}

ExportHTML() is a function that reads in a html file and outputs it to the 
client.



Matt

At 02:19 PM 1/16/01, you wrote:

Matt,

You are doing 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: [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 the "pg"
variable. I thought maybe I was doing something wrong with the URL in how
the parameters were being passed in the GET that's being executed when the
URL is clicked on. The first parameter "load" is always correct.

The separation between values passed is the "" symbol, right?

I'm using Tomcat 3.2.1, JDK 1.3, and IE 5.5 on a Win98 machine.

Thanks!

Matt


At 01:58 PM 1/16/01, you wrote:
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: getParameter() help
Date: Tue, 16 Jan 2001 12:50:28 -0800

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 request.getParameter("page") the string I get is
"mainservlet?cmd=load" which is not right.
Does anyone know if I'm doing something wrong with how I'm writing the link
back to the servlet?
Thanks!

Matt Becker




Mythicwave Productions, Inc.
21053 Devonshire, #201
Chatsworth, Ca. 91311
818-700-1998
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

_
Get your FREE download of MSN Explorer at http://explorer.msn.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

_
Get your FREE download of MSN Explorer at http://explorer.msn.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: getParameter() help

2001-01-16 Thread Ramkumar Manoharan

Matt,

Did 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() 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");

 if (cmd == null || cmd.equals(""))
 {
 ExportHTML(request, response, filePath + "default.htm");
 }
 else if (cmd.equals("load"))
 {
 String pgName = request.getParameter("pg");

 if (pgName == null || pgName.equals(""))
 {
 System.out.println("page is missing or empty!!!");
 }
 else
 {
 System.out.println("Outputing page: " + pgName);
 ExportHTML(request, response, filePath + pgName +
".htm");
 }
 }
 else if (cmd.equals("search"))
 {
 }
}

ExportHTML() is a function that reads in a html file and outputs it to the
client.



Matt

At 02:19 PM 1/16/01, you wrote:

Matt,

You are doing 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: [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 the "pg"
variable. I thought maybe I was doing something wrong with the URL in how
the parameters were being passed in the GET that's being executed when 
the
URL is clicked on. The first parameter "load" is always correct.

The separation between values passed is the "" symbol, right?

I'm using Tomcat 3.2.1, JDK 1.3, and IE 5.5 on a Win98 machine.

Thanks!

Matt


At 01:58 PM 1/16/01, you wrote:
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: getParameter() help
Date: Tue, 16 Jan 2001 12:50:28 -0800

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 request.getParameter("page") the string I get is
"mainservlet?cmd=load" which is not right.
Does anyone know if I'm doing something wrong with how I'm writing the 
link
back to the servlet?
Thanks!

Matt Becker




Mythicwave Productions, Inc.
21053 Devonshire, #201
Chatsworth, Ca. 91311
818-700-1998
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

_
Get your FREE download of MSN Explorer at http://explorer.msn.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

_
Get your FREE download of MSN Explorer at http://explorer.msn.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


_
Get your FREE download of MSN Explorer at http://explorer.msn.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: getParameter() help

2001-01-16 Thread CPC Livelink Admin


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
http://localhost:8080/livelink/ms/foo.jsp?cmd=loadpg=foo

JSP Below
-

HTML
HEAD
/HEAD?
BODY
%
 String cmd = request.getParameter("cmd");

 if (cmd == null || cmd.equals(""))
 {
%
H1Nothing in cmd/H1
%

 }
 else if (cmd.equals("load"))
 {
 String pgName = request.getParameter("pg");

 if (pgName == null || pgName.equals(""))
 {
%
  h1page is missing or empty!!!/h1
%
 }
 else
 {
%
h1Outputing 
page: %= pgName %/H1
%
 }
 }
 else if (cmd.equals("search"))
 {
 }
%

/BODY
/HTML


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: getParameter() help

2001-01-16 Thread Stefan Langer

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 something is getting the request substitutes 
home with the pageaddress and then redirects it to your servlet. Since it is working 
on my tomcat I don't assume that it is tomcat. Try using some other word then home and 
see if you are getting the same results. 

STefan




Re: getParameter() help

2001-01-16 Thread Matt Becker

Hi, Ram.

Yes, I just recently tried out what Elijah suggested and I also re-started 
everything, including re-compiling all my java source and scouring through 
my html code...and so far I believe it works!

There must have been something about using "page" and "home" in my link and 
probably an error in my overall html writing  and then I had to make sure 
everything was restarted properly. Elijah's recommendation of checking the 
links at the bottom of the web browser helped a lot.

Much appreciation to you guys!



Matt

At 03:01 PM 1/16/01, you wrote:
Matt,

Did 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() 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");

 if (cmd == null || cmd.equals(""))
 {
 ExportHTML(request, response, filePath + "default.htm");
 }
 else if (cmd.equals("load"))
 {
 String pgName = request.getParameter("pg");

 if (pgName == null || pgName.equals(""))
 {
 System.out.println("page is missing or empty!!!");
 }
 else
 {
 System.out.println("Outputing page: " + pgName);
 ExportHTML(request, response, filePath + pgName +
".htm");
 }
 }
 else if (cmd.equals("search"))
 {
 }
}

ExportHTML() is a function that reads in a html file and outputs it to the
client.



Matt

At 02:19 PM 1/16/01, you wrote:

Matt,

You are doing 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: [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 the "pg"
variable. I thought maybe I was doing something wrong with the URL in how
the parameters were being passed in the GET that's being executed when the
URL is clicked on. The first parameter "load" is always correct.

The separation between values passed is the "" symbol, right?

I'm using Tomcat 3.2.1, JDK 1.3, and IE 5.5 on a Win98 machine.

Thanks!

Matt


At 01:58 PM 1/16/01, you wrote:
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: getParameter() help
Date: Tue, 16 Jan 2001 12:50:28 -0800

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 request.getParameter("page") the string I get is
"mainservlet?cmd=load" which is not right.
Does anyone know if I'm doing something wrong with how I'm writing 
the link
back to the servlet?
Thanks!

Matt Becker




Mythicwave Productions, Inc.
21053 Devonshire, #201
Chatsworth, Ca. 91311
818-700-1998
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

_
Get your FREE download of MSN Explorer at http://explorer.msn.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

_
Get your FREE download of MSN Explorer at http://explorer.msn.com


--