• 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 executions of listeners

 
Bartender
Posts: 2418
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to chapter 8.2.3 of servlet 3.0:


Prior to this release of the specification, context listeners were invoked in
random order. As of Servlet 3.0, the listeners are invoked in the order in which
they are declared in the web.xml as specified below:
i. Implementations of javax.servlet.ServletContextListener are
invoked at their contextInitialized method in the order in which they
have been declared, and at their contextDestroyed method in reverse
order.

ii. Implementations of javax.servlet.ServletRequestListener are
invoked at their requestInitialized method in the order in which they
have been declared, and at their requestDestroyed method in reverse
order.
iii. Implementations of javax.servlet.http.HttpSessionListener are
invoked at their sessionCreated method in the order in which they have
been declared, and at their sessionDestroyed method in reverse order.
iv. The invocation order for any of the other listener interfaces is unspecified.



So, according to this specification, does it mean all ServletContextListeners must be executed before all ServletRequestListeners and all ServletRequestListeners must be
executed before all HttpSessionListeners?
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, I think this specifies the ordering per category. Not the categories themselves.
 
It will give me the powers of the gods. Not bad for a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic