| Author |
need help on question on sessions
|
Niranjan Deshpande
Ranch Hand
Joined: Oct 16, 2005
Posts: 1277
|
|
4. Which of the following methods will be invoked on a session attribute that implements appropriate interfaces when the session is invalidated? (Select one) a sessionDestroyed of HttpSessionListener b attributeRemoved of HttpSessionAttributeListener c valueUnbound of HttpSessionBindingListener d sessionWillPassivate of HttpSessionActivationListener Answer: c Explanation The HttpSessionListener and HttpSessionAttributeListener are configured in the deployment descriptor. Therefore, even if a session attribute implements these interfaces, the sessionDestroyed() and attributeRemoved() methods will not be called on that attribute. in my opinion, the anwer is b - since the question asks "...invoked on a session attribute...." also the explanation doesnt make any sense. please explain.
|
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14672
|
|
Attributes implement HttpSessionBindingListener, not HttpSessionAttributeListener. The question is about "methods will be invoked on a session attribute". So it will not be 'b'.
|
[My Blog]
All roads lead to JavaRanch
|
 |
Rick Roberts
Ranch Hand
Joined: Apr 07, 2005
Posts: 59
|
|
The following class implements HttpSessionBindingListener which will allow it to be notified when added to a session as an attribute, or removed from a session. [ October 18, 2006: Message edited by: Rick Roberts ]
|
SCJP
"Stay on the path."
|
 |
 |
|
|
subject: need help on question on sessions
|
|
|