File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to maintain user name in all the Jsp pages
 
Similar Threads
Customize Login Page Based on Url in J2ee Application
best way to implement session handling
cookie and login
How can i use Session in login page
How to control static pages and dynamic pages