Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding Listener Concept

 
yekkala krishna
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am following Hanumant Deshmukh material for preparation of SCWCD Exam.I have small query regarding the following question.Actually when any object is added to a session HttpSessionBindingListener will notify.but they are saying HttpSessionAttributeListener will call. Can Anybody explain clearly regarding the below question?

Which interface must a class implement so that instances of the class are
notified after any object is added to a session?
A. javax.servlet.http.HttpSessionListener
B. javax.servlet.http.HttpSessionValueListener
C. javax.servlet.http.HttpSessionBindingListener
D. javax.servlet.http.HttpSessionAttributeListener
Answer: D

With Regards,
Rama Krishna.Y
 
Ankit Garg
Sheriff
Posts: 9580
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is asking about "any object" added to session. if your class implements HttpSessionBindingListener, then it will be notified when instances of that class are added to the session. A class that implements HttpSessionAttributeListener is notified when an instance of any object is added to the session...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic