Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSP and the fly likes Session Detection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Session Detection" Watch "Session Detection" New topic
Author

Session Detection

Jon Kidd
Greenhorn

Joined: Oct 11, 2002
Posts: 29
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

Joined: Oct 11, 2002
Posts: 29
Found the answer, easy when you know how !! Just need to use the Boolean isNew() method for session..... d'oh!!
Jon
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session Detection