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 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 Murach's Java Servlets and JSP this week in the Servlets 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: 9291
    
  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
Doubt regarding session attributes
Session expiry in servlet
Session problem in Struts and Tomcat
Do JSPs always create a session?
remove all user Sessions