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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 8836

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.

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Session checking in struts2
Similar Threads
Redirect to another action in Interceptor
Struts 2 problem-actions cant find the result. WARNING: Could not find action or result
Struts2 struck with a issue of 404
struts2 Execute and Wait Interceptor - progress bar
Session handling in struts.