This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
Similar Threads
doubt in session
Session problems with JSP on ServletExec, W2000
Problem with session tracking
URGENT Help Needed ...!!
How to update Session variable with Form Data ?