| Author |
HSJS Chapter-6 Question-15
|
Peter Piddle
Greenhorn
Joined: Jun 13, 2012
Posts: 26
|
|
Hi All,
I am solving mock from K&B from Chapter 6. The question asks
Which method(s) can be used to ask the container to notify your application whenever a session is about to timeout?
Options correct are A and C
A.HttpSessionListener.sessionDestroyedC. HttpSessionBindingListener.valueUnBound
My question is the valueUnBound() method is related when an attribute is removed from the session, session might be existing that time.
Then why option C is made correct?
Thanks,
|
Peter Piddle - Skype(peter.piddle)
|
 |
Frits Walraven
Rancher
Joined: Apr 07, 2010
Posts: 1042
|
|
Hi Peter,
Then why option C is made correct?
According to the API:
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 from a session, due to a session being invalidated, or due to a session timing out.
Regards,
Frits
|
 |
 |
|
|
subject: HSJS Chapter-6 Question-15
|
|
|