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 How to maintain user name in all the Jsp pages 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 "How to maintain user name in all the Jsp pages" Watch "How to maintain user name in all the Jsp pages" New topic
Author

How to maintain user name in all the Jsp pages

Dev Anand
Ranch Hand

Joined: Aug 30, 2009
Posts: 41
I have a web application which has 'Login' feature. Once I login to the application, it should check in all the Jsp Pages that it is logged in or not. If not, the application should be redirected to the login page quoting that 'He should login to use the application'.

I want to implement timeout feature also.

With Regards
Dev Anand. P
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874


Dev,
First thing, dont program to access your jsp directly unless there are no server-side processing involved.

"Session" is what you should be after. Configure a Filter to check if a user belongs to any session , (you could check with HttpSession methods) and route to login page accordingly.
 
wood burning stoves
 
subject: How to maintain user name in all the Jsp pages
 
Similar Threads
How to control static pages and dynamic pages
How can i use Session in login page
cookie and login
Customize Login Page Based on Url in J2ee Application
best way to implement session handling