![]() |
JBridge: Certification Question Of The Day |
| JBridge Home >> Certification Questions >> Question for Tuesday May 20th 2003 | Tuesday May 20th 2003 |
|
Identify the correct listener interface methods which potentially would be triggered by running the following servlet code, and the order in which they would trigger. Assume that MyListeningObject implements an appropriate listener for objects being bound or unbound from a session. Assume also that web.xml has a listener class set up that has an interest in session attributes.
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
MyListeningObject mlo = new MyListeningObject();
HttpSession session = request.getSession();
session.setAttribute("MyAttribute", mlo);
}
(1 correct answers)
A First HttpSessionObjectListener.objectAdded(HttpSessionObjectEvent hsbe), second
HttpSessionAttributeListener.attributeAdded(HttpSessionBindingEvent hsbe).
B First HttpSessionAttributeListener.attributeAdded(HttpSessionBindingEvent hsbe), second
HttpSessionObjectListener.objectBound(HttpSessionBindingEvent hsbe).
C First HttpSessionBindingListener.valueBound(HttpSessionBindingEvent hsbe), second
HttpSessionAttributeListener.attributeAdded(HttpSessionBindingEvent hsbe).
D First HttpSessionAttributeListener.attributeAdded(HttpSessionAttributeEvent hsbe), second
HttpSessionBindingListener.valueBound(HttpSessionBindingEvent hsbe).
E First HttpSessionAttributeListener.attributeAdded(HttpSessionBindingEvent hsbe), second
HttpSessionListener.valueBound(HttpSessionBindingEvent hsbe).
Page down for the answer... The AnswerThe correct answer is C.
|
EMail: dbridgewater@jbridge.co.uk
Phone: +44 (0)1943 877414
Fax: +44 (0)1943 877414
Mail: David Bridgewater, Willow Dene, Bradford Road, Menston, Ilkley, West Yorkshire, LS29 6ED, UK
Copyright © 2003 David Bridgewater. All rights reserved.