aspose file tools*
The moose likes Struts and the fly likes best way for session handling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "best way for session handling" Watch "best way for session handling" New topic
Author

best way for session handling

ankurshah shah
Greenhorn

Joined: Aug 27, 2009
Posts: 2
i want to create session in STRUTS2 such that when user tries to view any page without logging in then he will be redirected to login page.
please tell me how should i do it. Should i use interceptors?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

You can use interceptors for this if your user doesn't get to any JSP page directly (i.e. without going through a struts action). If the user has access to some JSP pages directly, then you might use a servlet filter for this purpose...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: best way for session handling
 
Similar Threads
Session expiry in servlet
Do JSPs always create a session?
Doubt regarding session attributes
remove all user Sessions
Session problem in Struts and Tomcat