On 14/06/2013 07:55, Violeta Georgieva wrote:
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?

Short answer - yes, I agree.

I then went to look at the code to figure out how / where to do this and it took me a little while to figure out what was going on. I've added a bunch of comments to clarify things that I'll commit shortly. Now I understand the code again, the fix looks simple.

Mark




o.a.catalina.core.ApplicationContext.addListener(T t)
...
         if (t instanceof HttpSessionListener
                 || (t instanceof ServletContextListener &&
                         newServletContextListenerAllowed)) {
->            context.addApplicationLifecycleListener(t);
             match = true;
         }
....



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to