Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confusion in HttpSessionBindingListener and HttpSessionAttributeListener

 
Adnan Ahmed
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
can someone tell me what is the major difference between HttpSessionBindingListener and HttpSessionAttributeListener. becoz these two interfacing is confusing me. I think the functionality of interfaces is all most if i understood their functionality right.
 
Nauman Khan
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpSessionAttributeListener interface allows a developer to recieve notifications whenever changes occur to the attribute list of the HttpSession object such as adding a new attribute,removing an existing attribute and replacing an existing attribute.it is configured in deployment descripter.
HttpSessionBingingListener is implemented by the classes whose object need to recieve notifications whenever they are added to or removed from a session.It's not required to explicitly mention it in deployment descriptor.Hence an object is added to or removed from any session,the container calls the interface implemented by that object.
Regards,
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
The servlet container calls method on an object implementing HttpSessionBindingListener only if that particular object is added or removed from the session. On the otherhand if a listener class implements HttpSessionAttributeListener, container will call its method if any object is added or removed from session.
---------------
Sainudheen
 
Adnan Ahmed
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nauman Khan
i was making a little mistake but now i have understood
 
Adnan Ahmed
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nauman Khan
i was making a little mistake but now i have understood
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic