File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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: 9463

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