• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HttpSessionActivationListener

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic