| Author |
HttpSessionActivationListener
|
parra matta
Ranch Hand
Joined: Mar 23, 2006
Posts: 40
|
|
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
Joined: Nov 24, 2005
Posts: 14672
|
|
HttpSessionBindingListener and HttpSessionActivationListener are not configured in the DD. Check the errata: http://www.oreilly.com/catalog/headservletsjsp/errata/headservletsjsp.confirmed
|
[My Blog]
All roads lead to JavaRanch
|
 |
parra matta
Ranch Hand
Joined: Mar 23, 2006
Posts: 40
|
|
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
Joined: Aug 18, 2005
Posts: 220
|
|
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.
|
 |
 |
|
|
subject: HttpSessionActivationListener
|
|
|