Client code that register itself as a HttpSessionBindingListener insider GlassFish v184.108.40.206 and v4 should not be signaled via valueUnbound() unless the object is really being unbound from a session.
Whenever I register a HttpSessionBindingListener insider GlassFish v220.127.116.11 and v4 the valueUnbound() method is called with HttpSessionBindingEvent.getValue() null immediately after valueBound() when I register an object.
- Create your own filter and implementation of HttpSessionBindingListener
- Register an object and notice the sequence of callback as valueBound() with a valid HttpSessionBindingEvent.getValue() fallowed by valueUnbound() with a null HttpSessionBindingEvent.getValue()
Conform the JavaDoc on HttpSessionBindingListener the valueUnbound() method:
Notifies the object that it is being unbound from a session and identifies the session.
Thus it would be wrong to have it called immediately after valueBound().