Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Listeners -- Big Confusion

 
Ranch Hand
Posts: 163
  • 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
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://faq.javaranch.com/view?DeclaringListeners
 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpSessionBindingListener and HttpSessionActivationListener need not be configured in DD.
 
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
 
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
 
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
 
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..
    Bookmark Topic Watch Topic
  • New Topic