File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HttpSessionBinding interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HttpSessionBinding interface" Watch "HttpSessionBinding interface" New topic

HttpSessionBinding interface

saxena Amit

Joined: Jun 17, 2005
Posts: 5
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

Joined: Nov 20, 2001
Posts: 30
Wouldn't using the HttpSessionListener methods help ?

Sushma Sharma
Ranch Hand

Joined: Jun 02, 2005
Posts: 139

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...
It is sorta covered in the JavaRanch Style Guide.
subject: HttpSessionBinding interface
It's not a secret anymore!