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?