File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Auto logout in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Auto logout in Struts" Watch "Auto logout in Struts" New topic
Author

Auto logout in Struts

Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

How to implement Auto logout feature in Struts based application.?
Example: I have a simple Struts Application and i want it to Auto logout if session is inactive for 1 hr or currently no user is using my Struts based application for 1hr...Please advice Ranchers


When The Going Gets Tougher,The Tougher gets Going
Cesar Coz
Ranch Hand

Joined: Aug 19, 2010
Posts: 31
Hello Deepak,

this is what i would do.. i would add a filter to check the session when you make an 'action' and set the filter to expire the session if is inactive in 60m. If there's no session the app will redirect you to an error page

hope this will help you


Cesar Coz.
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

How to implement in Struts 1.x ,Can you suggest/advice me on how to use a filter for above implementation.
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

Can't you just set the session timeout in the web.xml file?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Auto logout in Struts
 
Similar Threads
How to create objects in jsps using struts tags?
Spring : how to redirect to login page on session timeout
Roles and Authentication
Using form based authentication and Struts
Auto Pagination