• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSessionActivationListener Question

 
Grace Yang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am unclear about what's happening HttpSessionActivationListener...

Following is a D&D from Whizlab:
--------------------------------------
public class myListener implements HttpSessionActivationListener
{
public void sessionWillPassivate(HttpSessionEvent e )
{
System.out.println("session is saved.");
}

public void sessionDidActivate( HttpSessionEvent e )
{
System.out.println("session is restored.");
}
}
------
My question is : sessionWillPassivate means session is saved?
sessionDidActivate means session is restored?

Can anybody verify this? I am not quite sure since I found there are some obvious mistake in Whizlab :-(

Thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My question is : sessionWillPassivate means session is saved?

No. sessionWillPassivate means that the session is going to be migrated from one JVM to another. It is going to be serialized by the container. So you might want to do something special in here. sessionDidActivate notifies that the session has been deserialized.
 
Grace Yang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Satou !

I guess Whizlab is misleading at least at this question :-(
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic