Originally posted by Rama Raghavan:
Question Bank ID : 23(Choose the 1 correct answer)
A class that will recieve notification if an Attribute is added to or removed from a session will implement which interface?
1.HttpSessionAttributeListener
2.HttpSessionListener
3.HttpSessionBindingListener
4.HttpSessionObjectListener
Correct Answer (reported) was: 1
Issues with this question & reported answer:
1. It should have been HttpSessionAttributesListener
2. HttpSessionBindingListener also would have received a notification (valueBound/valueUnbound) when an attribute is added or removed
Any ideas?
Rama
[ November 22, 2002: Message edited by: Rama Raghavan ]
Hi Rama ,
It should be HttpSessionAttributeListener.Check out the API specification to clear the doubt.
The question asks "The Class" and not "the object" which should receive the notification if an attribute is added or removed from a session so the correct ans is HttpSessionAttributeListener and not HttpSessionBindingListener where the object receives the notification.
Hope this clears your doubt.
Trupti