• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP parameters. ( beginners question, probably easy)

 
Rob Earls
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic