• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Listeners -- Big Confusion

 
prashanth kumar
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello ranchers,
Can anybody tell me which of the listeners DOESNT need configuration in Deployment descriptor.

1)K and B says HttpSessionBindingListener

2)Examulator says


3)And finally certmag
says


Can anybody point to right answer?

Many Thanks
Prashanth
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://faq.javaranch.com/view?DeclaringListeners
 
Rohitt Vermaa
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpSessionBindingListener and HttpSessionActivationListener need not be configured in DD.
 
VijayKumar Sivagnanam
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Think only option D is correct. For HttpSessionActivationListener, we need to specify it in the Deployment Descriptor

Regards
Vijay
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No both HttpSessionBindingListener and HttpSessionActivationListener are not required to configure in Deployment Descriptor
 
Punit Pagi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We need to add the <listener> tag for HttpSessionActivationListener,but we donot need to add it for HttpSessionBindingListener so the correct answer is only D
 
Micheal John
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The HttpSessionBindingListener and HttpSessionActivationListener are not configured in the deployment descriptor. The HttpSessionBindingListener interface is implemented by the classes whose objects need to receive notifications whenever they are added to or removed from a session. We do not need to inform the container about these objects through the deployment descriptor because the container introspects the interfaces implemented by them and calls the corresponding notification methods. Similarly the SessionActivationListener interface is used by the session attributes to receive notifications when a session is being migrated from one JVM to another. Other than these two interfaces, all the other listeners need to be configured in the deployment descriptor. Hence choices D and E are correct while choices A, B, C and F are incorrect.


The above quote is true.. only HttpSessionBindingListener and HttpSessionActivationListener don't need to registered in web.xml..

Errata in HFSJ is confirmed by Bryan.. and I forget that link..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic