This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: forward from one JSP to another JSP
 
Similar Threads
JSP Expression question
Servlets - Request - Threads question?
Buttons on a JSP
session problem
jsp-vector