Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Detection

 
Jon Kidd
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
relatively new to jsp and servlets so bear with me please...
I am trying to create a jsp page with a simple form, this form then calls a servlet to validate the fields and if they have not been filled in correctly then it forwards back to the form page.
I am having trouble though detecting on the jsp page as to whether the form has been checked already. I have tried setAttribute for the session but this is causing nullPointer problems when I first access the form as I think it is trying to access attributes from the session that don't currently exist ?
If anyone has a simple solution to this problem then I'd be grateful for some help, apologies for the lack of code but I think it best if maybe someone just hints out the proper way of doing it and I'll try that before posting anything.
Thanks in advance
Jon
 
Jon Kidd
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found the answer, easy when you know how !! Just need to use the Boolean isNew() method for session..... d'oh!!
Jon
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic