Chris Duerr

Greenhorn
+ Follow
since Apr 30, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chris Duerr

I subscribe to this point of view. Nevertheless, it is not in the errata of the HF 1st edition.
hi there,

I was concerned with the same probleme for a while. And this was mainly because the HF states a HttpSessionActivationListener can be both, an attribute class instance bound to a session AND "some other class". They even give an example on that (HF SCWCD pp. 261).

That's confusing and may explain bernards original post. By now I guess the HF is wrong - only attribute classes can implement HttpSessionActivationListener in a meaningful way.

Justification:

1) The spec says that and nothing else.
2) I tried it with Tomcat, attribute classes where triggered correctly, "some other classes", properly declared in the DD, not. OK, I didn't run a cluster to test this. I redeployed a single instance to trigger the passivation and activation of the session, thus the test is not perfect.
3) What will happen, if the attribute class has not the no-arg constructor and is registered as HttpSessionActivationListener in the DD (as suggested in the HF)? How will the container create an instance to call its methods?

Has anyone out there ever seen a HttpSessionActivationListener declared in the DD but not bound to a session triggered?

Chris