Hi, Lets assume there is a class A which implements this interface ,so it has two methods in it ie valueBound and valueUnbound. Whenever we make an object of class A ,lets say B,that object B has these two methods available to it . Now if we add B to a session ,the container calls B's sessionBound method prior to binding it to the session and when B is to be removed from the session the container calls its unBound method prior to unbinding it from the session. Thus these two methods provide us the oppertunity to take any actions required prior to the attribute being bound to a session and then later released from it.
HttpSessionBindingListener: When an class implementes this interface it Causes an object to be notified when it is bound to or unbound from a session. The object is notified by an HttpSessionBindingEvent object. This may be as a result of a servlet programmer explicitly unbinding an attribute using removeAttribute of HttpSession or due to a session being invalidated using HttpSession.invalidate() , or due to a session timing out.
Hope this helps.
SCJP, SCWCD, SCBCD
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop