This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Struts and the fly likes checking to see if session timed out Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "checking to see if session timed out" Watch "checking to see if session timed out" New topic
Author

checking to see if session timed out

John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
I am currently using ServletRequestAware in my Actions to get at the session. Why don't I use SessionAware? Becuase I need to check if the session is still alive:

httpsession = httpServletRequest.getSession(false);
if (httpsession == null) {
//session died
return GallupConstants.STRUTS_RESULT_NAME_TIMEOUT;
}

I would rather use SessionAware becuase I believe ServletRequestAware might be interfering with the execAndWait interceptor. How can I do this check with SessionAware?

Thanks,
eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: checking to see if session timed out
 
Similar Threads
Session checking with Struts 2
How to SET and GET session objects in Struts Action classes ???
Adding a time stamp parameter in order to force a new http session opening a new browser window
setting attribute in struts2.
Session