wood burning stoves 2.0*
The moose likes Servlets and the fly likes session listener - a query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "session listener - a query" Watch "session listener - a query" New topic
Author

session listener - a query

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
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

Joined: Dec 24, 2005
Posts: 3
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

Joined: Oct 11, 2004
Posts: 3830
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.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: session listener - a query
 
Similar Threads
Why need a client id when lock and unlock?
Difference b/w HttpSessionAttributesListener and HttpSessionBindingListener
List of active sessions
Need some explanation of HttpSessionBinding Listener
how can i update the databse for partcular user_id after session is expire ?