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 Servlets and the fly likes servlet session tracking 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 » Servlets
Bookmark "servlet session tracking" Watch "servlet session tracking" New topic
Author

servlet session tracking

Chris Snapp
Greenhorn

Joined: Nov 14, 2003
Posts: 16
Hi all,
This is most likely a common problem, but many a day has been spent working on it prior to this post.
I'm attempting to check for the existance of a "user" object in a session. If it exists then I want to parse the provided "run" parameter for method names and invoke them. If the "user" object does not exist than I want to direct the person to the login screen.
The login method will create the user based on a successful login attempt.

My problem is that by attempting to check if I always end up with it equaling null and so I always hit the login function.
-Chris

edited by MC: removed tabs from code.
[ December 02, 2003: Message edited by: Mike Curwen ]
shankar vembu
Ranch Hand

Joined: May 10, 2001
Posts: 309
are you setting the object user to the session anywhere?
Benny Tang
Greenhorn

Joined: Aug 03, 2003
Posts: 26
Hi,
Have you bind the instance of class User if the login process is successful ?
Benny
Chris Snapp
Greenhorn

Joined: Nov 14, 2003
Posts: 16
Shankar - I'm setting the user object in the login method (see below)
Benny - Sorry I'm pretty new to the Java world so I'm not sure about what you're talking about.
edited by MC: converted tabs to spaces in code.
[ December 02, 2003: Message edited by: Mike Curwen ]
 
jQuery in Action, 2nd edition
 
subject: servlet session tracking
 
Similar Threads
Session Expiry
httpheader no caching off pdf?
How to refresh a Servlet automatically ?
session validation problem in servlet/jsp
issue with res.sendRedirect