[Logo]
Forums Register Login
Quick Question HttpSessionBinding vs HttpSessionAttribute Listeners
What is the difference between them?
I like to implement HttpSessionBindingListener in an object that needs to save itself when a session is invalidated. We have an on-line exam that does that if the user is dropped or logged off before finishing so the test can be resumed.
Bill
-binding- is implemented by the object which will
be set as session's attribute. it notifies this object when it is bound or unbound with a session.
(valueBound/valueUnbound methods...).
-attribute- is implemented by your servlet and throws an event when an object (attribute) is added, removed or replaced in session.
so, what makes the difference is the "side" you want to be notified about the event - does your object has to "know" it was addedor removedfrom a session or does your session has to " know" anattribute was added/removed/replaced in it.
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards


This thread has been viewed 1367 times.

All times above are in ranch (not your local) time.
The current ranch time is
Apr 23, 2018 15:22:30.