2013/6/12 <ma...@apache.org> > > Author: markt > Date: Wed Jun 12 18:31:30 2013 > New Revision: 1492331 > > URL: http://svn.apache.org/r1492331 > Log: > With clarification from the EG for Servlet 3.1 section 4.4 finally makes sense. Implement the necessary restriction and add a test case. >
I think that we should provide the same restriction for the ServletContextListeners that are not described in web.xml/web-fragment.xml or are not annotated. For example such listeners can be added by ServletContainerInitializer. What do you think? o.a.catalina.core.ApplicationContext.addListener(T t) ... if (t instanceof HttpSessionListener || (t instanceof ServletContextListener && newServletContextListenerAllowed)) { -> context.addApplicationLifecycleListener(t); match = true; } ....