• Post Reply Bookmark Topic Watch Topic
  • New Topic

HttpSessionAttributeListener vs HttpSessionBindingListenter  RSS feed

 
ming zhu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can someone please explain the difference between these two interfaces? When do I use them? I guess I do not understand the exact meaning of binding.
Thanks in advance.
 
Andy Wong
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is a rephase of what I got from the SCWCD Exam Study Kit:
"Difference between HttpSessionAttributeListener and HttpSessionBindingListener is that HttpSessionAttributeListener is configured in the deployment descriptor and the container creates only one instance of the specified class. While HttpSessionBindingListener is not configured in the deployment descriptor. The servlet container calls methods on an object implementing this interface only if that object is added or removed from a session. While the HttpSessionAttributeListener interface is used to track the activity for all sessions on an application, the HttpSessionBindingListener interface is used to take actions when certain kinds of objects are added or removed from a session."
Thanks,
Andy
 
ming zhu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Andy!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!