• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP parameters. ( beginners question, probably easy)

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!
 
Happily living in the valley of the dried frogs with a few tiny ads.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic