Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Confusion in HttpSessionBindingListener and HttpSessionAttributeListener

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Nauman Khan
i was making a little mistake but now i have understood
 
reply
    Bookmark Topic Watch Topic
  • New Topic