and HttpSessionBindingListener, do not be configured in DD since the Container calls the event handling (valueBound() & valueUnbound()) when an intance of certain class is added to or removed from a session.
almost the same words from HFSJ.. well it is the SAME.
Diploma in Computer Studies
Formula 1 app by Maxis (Playbook)
Hi, according to HFSJ(Pg:254), HttpSessionActivationListener also need to be registered in DD. On what basis you guys are saying that it is not needed to register? But HFSJ book doesnt talk much on other types of listerners also. My question is request and context listeners need to be registerd in DD or not? I am guessing except HttpSessionBindingListner, all other listeners must be registered in DD.
SCJA, SCJP, SCWCD, SCBCD, SCDJWS.
Joined: Nov 16, 2003
according to HFSJ(Pg:254), HttpSessionActivationListener also need to be registered in DD. On what basis you guys are saying that it is not needed to register?
The container creates one instance of each of these listeners.
2. Those that are interested only in specific events of one type. (there are 2 listeners of this type - HttpSessionBindingListener (interested in knowing when it is itself bound / unbound to a HttpSession) and HttpSessionActivationListener(interested in knowing when only the session it is bound to is activated or passivated, so that it can prepare itself for activation / passivation)
We create the instances of these listeners and set them as attributes in specific http sessions.
The first type of listeners are configured in the DD - as their methods are ALWAYS called when the event occurs.
The second type of listeners are not configured in the DD.
On page 262 in HFSJ, it is mentioned that HttpSessionActivationListener interface may usually be implemented by an attribute class or some other class. I think this is not correct - HttpSessionActivation should always be implemented by an attribute class. - Gouri [ September 27, 2005: Message edited by: Gouri Bargi ]
Joined: Mar 16, 2005
Yes, I agree. I think the HSActivationListener should not be implemented by "other" class.
Thanks for giving such detail explaination. I guess an easy way to remember is: All listener that are implemented by attribute obj. should NOT be registered in DD. They are HSBindingListener and HSActivationListener. For everything else (servlet context and request, other HttpSession listener), you must declare in DD. The order of them in DD matters.