aspose file tools*
The moose likes Servlets and the fly likes forward from one JSP to another JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "forward from one JSP to another JSP" Watch "forward from one JSP to another JSP" New topic
Author

forward from one JSP to another JSP

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
Whenever I submit or forward from one jsp to
another jsp I cannot use the passed variables
correctly. Example...
<%String event = request.getParameter("EVENT");
out.print(event);
if (event="Test") {
out.print("Check");
}%>

If I call this file and pass in event="Test", it will
print it correctly, but when I use it in a conditional
statement it doesn't understand it. It will not print
the word "Check".
Please help.
Jayant Shirkhedkar
Greenhorn

Joined: Aug 08, 2001
Posts: 2
Hey JaiPei,
Try using this
if (event.equals("Test")
out.print...
OR
if (event.equalsIgnoreCase("Test")
out.print...
These are methods given by String of Java.
look up on http://java.sun.com/j2se/1.4/docs/api/index.html
for more info.
FYI the syntax
if(event="Test") would always equate event to Test
the comparison is done using "=="

all the best
 
Don't get me started about those stupid light bulbs.
 
subject: forward from one JSP to another JSP