This week's book giveaway is in the JavaScript forum.
We're giving away four copies of JavaScript Promises Essentials and have Rami Sarieddine on-line!
See this thread for details.
The moose likes Servlets and the fly likes JSP parameters.  ( beginners question, probably easy) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP parameters.  ( beginners question, probably easy)" Watch "JSP parameters.  ( beginners question, probably easy)" New topic
Author

JSP parameters. ( beginners question, probably easy)

Rob Earls
Greenhorn

Joined: Sep 19, 2001
Posts: 12
Having a lot of "fun" at the moment I'm sure this is really obvious but it has me stumped....
I have three JSP files
login.jsp -> validate.jsp -> menu.jsp
My login.jsp passes it's parameters to validate.
If the validation fails, it passes a parameter back to login.jsp to say "invalid password".
This is my "catch 22" situation. If I try to access a parameter before it has been set, then I get an "Internal Servlet Error"
Thus, the first time I access login.jsp, I get this error.
What am I doing wrong?
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
Check to see if your parameter exists before you try to do anything with it. For example:

I'm not sure if this is what you want, but if you post your code here I can help you out some more.
Rob Earls
Greenhorn

Joined: Sep 19, 2001
Posts: 12
Actually that is exactly what I needed.
I assumed that the getParameter call was causing the error, when really it was because I was using the variable ( which was null ) later in the code.
Thanks!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP parameters. ( beginners question, probably easy)