Is it possible to intercept the cleanup of session scoped objects, after a session has been invalidated either by timout or an invalidate function?

Rajendra Lande

Yes! It is possible to intercept the cleanup of session scoped objects, after a session has been invalidated. To do this, we have to implement the Java Servlet API's HttpSessionBindingListener interface. Doing this enables the objects to receive notifications of the session events. The interface defines only two methods:

public void valueBound(HttpSessionBindingEvent e)
public void valueUnbound(HttpSessionBindingEvent e)
The valueBound() method is called when the object is first stored in the session. The valueUnbound() method is called when the object is being removed from the session. It possible to intercept the cleanup of session scoped objects, after a session has been invalidated either by timout or by an invalidate function by using the valueUnbound() method.
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact