my dog learned polymorphism
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
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: 9405
    
  20

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: best way for session handling
 
It's not a secret anymore!