• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Order of notification for listeners

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
I want to know that in which order the registere listeners will be notified. Means suppose i have registered ServletContextListener,ServletRequestListener,HttpSessionListener then in which order they will be called by container?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They are called when the appropriate event occurs. ServletContextListener reacts to changes in the servlet context og the applciation (e.g. Servlet initialisation). ServletRequestListener reacts to requests. HttpSessionListener reacts to session creation/deletion events.
 
Devang Ganatra
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply..

So if i have registered
ServletContextListener ,HttpSessionListener,ServletRequestListener then first ServletContextListener will be called, second ServletRequestWill be called , and last HttpSessionListener will be called right?? please correct me if i am wrong.
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As already mentioned the listener is called when the appropriate event occurs. So, obviously a servlet context event listener will be called before a servlet request or session event listeners.
[ September 29, 2008: Message edited by: Bosun Bello ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic