If a session is invalidated (timeout or explicitly calling invalidate()) does the attributes considered unbound and cause the HttpSessionBindingListener called?? This is not clearly defined in the spec which just say valueUnbound() is called when the attribute is "no longer available via the getAttribute() on the HttpSession inteface".
If the session itself no longer available, of course the getAttribute() also no long available. This seems to mean the valueUnbound() should also be called.
public void invalidate() Invalidates this session then unbinds any objects bound to it. [ September 28, 2005: Message edited by: Jeremy Leong ]
Joined: May 25, 2004
The spec reads:
"Some objects may require notification when they are placed into, or removed from, a session. This information can be obtained by having the object implement the HttpSessionBindingListener interface. This interface defines the following methods that will signal an object being bound into, or being unbound from, a session."
"The valueUnbound method must be called after the object is no longer available via the getAttribute method of the HttpSession interface." pg 39
the keyword that's being misread here is 'after' The section speicifies when actions are performed, and in the case of valueUnbound, it WILL be called when an object is unbound from a session, but ONLY after the attribute is unaccessible from the session. [ September 28, 2005: Message edited by: Jeremy Leong ]
subject: If a Session Timeout Will HttpSessionBindingListener Called