This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSessionBinding interface

 
saxena Amit
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on struts and ejb.
Is there a way to get a session's attribute after session timeout.I used

HttpSessionBinding interface.
public void valueUnbound(HttpSessionBindingEvent event) {
log.debug("User is UnBound as "+event.getSession().getId());

I am able to get the sessionId.
But it is not able to get attribute as tomcat already run removeAttribute().Server prompts error at this point.
How should I get attribute in valueUnbound(..)if session is timed out.
 
srinath anand
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wouldn't using the HttpSessionListener methods help ?
 
Sushma Sharma
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think srinath is correct. What you can do is implement HttpSessionListener and in the sessionDestroyed() method, you can save the attribute for further use...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic