Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

How can my application get to know when a HttpSession is removed?
You need to define a class, say SessionRemovedNotifier, that implements javax.servlet.http.HttpSessionBindingListener interface. HttpSessionBindingListener interface have two methods : valueBound() and valueUnbound(). Create a SessionRemovedNotifier object and add it to the user session. When the session is removed, SessionRemovedNotifier.valueUnbound() will be called by the web container. You can implement valueUnbound() to do whatever you want.