Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSessionActivationListener

 
parra matta
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In HFSJ, it says the HttpSessionActivationListener will be implemented usually by An attribute class and some other class. However it aslo says that you do not need to declare the listener class in DD. If it's implemented by some other class, how does the container find it?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpSessionBindingListener and HttpSessionActivationListener are not configured in the DD.

Check the errata:
http://www.oreilly.com/catalog/headservletsjsp/errata/headservletsjsp.confirmed
 
parra matta
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right about the DD configuration.

My question is if HttpSesstionActivationListener is implemented by a non-attribute class (some other class in HFSJ, page 262), will it be notified when session migrates? I know it will be notified if it's implmeneted by seesion attribute class, but how about non-attribute class?
 
Akshay Kiran
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just look at what you're saying

the container or the compiler, neither know if a javabean class is an attribute class or non-attribute class, all they care is whether you have implemented the interface or not,
if you implement the interface in a class, the class will be notified appropriately...but it wouldn't make much sense if a non-attribute class implemented the HttpSessionActivationListener, it also wouldn't make sense if a serializable attribute class implemented it...why? you tell me

of course there might be other not-so-obvious reasons where it would make sense for any class to implement this interface, but these I believe, are slightly out of the scope of the exam.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic