my dog learned polymorphism
The moose likes Struts and the fly likes Session checking in struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Session checking in struts2" Watch "Session checking in struts2" New topic

Session checking in struts2

saravanan Senthil

Joined: Jan 11, 2013
Posts: 11
I am new to sturts2 framework and I am doing application with session (SessionAware). I need to check whether session is exist or not whenever any action is invoked from struts.xml and if session is not available then I need redirect to login page.These check should be in in struts.xml or web.xml.please help me.thanks in advance!.
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

There's two ways to do this: first, you can use the JEE Standard, where you declare what resources you want to secure and the container enforces it, or you can examine the session yourself and handle the security actions in your code.
I prefer the JEE option, as I want to reinvent, write, test and maintain as little code as possible.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Session checking in struts2
It's not a secret anymore!