jQuery in Action, 3rd edition
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "best way for session handling" Watch "best way for session handling" New topic

best way for session handling

ankurshah shah

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

Joined: Aug 03, 2008
Posts: 9452

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
subject: best way for session handling
It's not a secret anymore!