• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSessionBindingListener

 
Bob Moranski
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I was wondering if anyone knows what a HttpSessionBindingListener is? What does it do?
Thanks!
 
Preethi Suryam
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
HttpSessionBindingListener is an interface.Is causes an object to be notified when it is bound to or unbound from a session. The object is notified by an HttpSessionBindingEvent object.
It has two methods
valueBound(HttpSessionBindingEvent event)
Notifies the object that it is being bound to a session and identifies the session.
valueUnbound(HttpSessionBindingEvent event).
Notifies the object that it is being bound from a session and identifies the session.
GoodLuck!
Preethi
 
Bob Moranski
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, how is an object "bound" or "unbound" to a session? Is "binding" done by session.putValue("bound", object)? How does an object get "unbound"?
Thanks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An object is unbound from a HttpSession when:
1) the session times out and is destroyed by the servlet engine
-or-
2) the object is removed with removeAttribute.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic