• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session listener - a query

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

What is the use of HttpSessionBindingListener?

If we want the object to be notified, when it is added into or removed from session, then this object has to be implement this interface...

I got this completely, but didn't get the use? how we can use this feature? any scenario???

The same with HttpSessionActivationListener... the object will be notified when session will be migrate to some other JVM...

Why the object needs to know that session is going somewhere else.... or what object can do in such situation....

Please comments...
Thanks.
[ December 23, 2005: Message edited by: rathi ji ]
 
venkat chaitanya pagadala
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey wassup
i would suggest you to get a copy of head first servlets and jsp by o'reilly publications to answer your query but this is the awy it works suppose you want to store the object's state in a file when the object is being passivated or activated the object has to be notified in order to make its state persistent since it is the responsibility of the container to make the object pasiive or active and the programmer would not know when that occurs you would implement the HttpSessionActivationListener and implement its methods to write the state to a file
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by venkat chaitanya pagadala:
hey wassup
i would suggest you to get a copy of head first servlets and jsp by o'reilly publications to answer your query but this is the awy it works suppose you want to store the object's state in a file when the object is being passivated or activated the object has to be notified in order to make its state persistent since it is the responsibility of the container to make the object pasiive or active and the programmer would not know when that occurs you would implement the HttpSessionActivationListener and implement its methods to write the state to a file


Thanks Venkat.

We are forced to keep our object Serializable so it can be written on a file while session migration, but we never implemented this HttpServletActivationListener and never written *writing object into file* code in it's method....

Wht it is so???

Please comments...

Thanks.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic