• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What will be the behavior of SessionActivation Listener in this case.

 
Abhishek Sharma
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rancher,

What will be the behavior of "SessionActivationListener" when an object is added to session in following manner.

session.setAttribute("myAttribute", new X());
session.setAttribute("myAttribute", new X());
session.setAttribute("myAttribute", "x");
session.removeAttribute("myAttribute");

where class X implements "SessionActivationListener"




Thanks in advance,
Abhishek
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no effect on SessionActivationListener, none of its method will be called
 
Anupama Ponnapalli
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you had implemented HttpSessionBindingListener, its valueBound would be invoked. If you had implemented HttpSessionAttributeListener, its attributeAdded()/attributeReplaced() method would be invoked.
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes....very correct !!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic