• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Which Listeners are mandatory in web.xml

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello People,

Out of the 8 Listeners,

ServletContextListener
ServletContextAttributeListener

ServletRequestListener
ServletRequestAttributeListener

HttpSessionListener
HttpSessionAttributeListener

HttpSessionBindingListener
HttpSessionActivationListener

Which of them are mandatory from declaration in the web.xml point of view.

Thanks for the help

Regards,
Yogesh.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You only need to remember that both HttpSessionActivationListener and HttpSessionBindingListener are not.
 
Yogesh Hingmire
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Satou !!! It helps
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi satou

i have a doubt on this i think only HttpSessionBindingListner ia not required to be mentioned in web.xml

though not very sure abt it.

anyone else please clarify.

thanks in advance.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ServletContextListener
ServletContextAttributeListener

ServletRequestListener
ServletRequestAttributeListener

HttpSessionListener
HttpSessionAttributeListener



Only these Listeners are mandatory.

following listeners need not be specfied in the web.xml, if your using HFSJ, pls check the errata there is a correction on this.

HttpSessionBindingListener
HttpSessionActivationListener

for Bhavana: Think these attributes are for the containers to take care off.
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Following is my understading about the Activation and Bonding Listeners.

The HttpSessionActivationListener and HttpSessionBindingLister are implemented by the attribute classes , which are added as session attributes.

HttpSessionActivationListener is notified when the attribute implementing it is migrated to another JVM.

HttpSessionBindingListeren is notified when the attribute implementing is is bounded or unbounded to session.

For the other attributes which are not implementing these Listeners, are not notified for the above events.

So for both there is no need to register in web.xml, because these are related to the attributes added to the session.

Alll other 6 listerers are related to lifecycle and attributes added to different scopes, so the container require to register it.

Hope this help.

Thanks
 
Bhavna Jharbade
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank You Gunaselan & Narendra..
now i am crystal clear abt this concept
 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic