Author: markt
Date: Sat Apr 24 23:26:20 2010
New Revision: 937722
URL: http://svn.apache.org/viewvc?rev=937722&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49181
Patch provided by Pid
Modified:
tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java
Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java?rev=937722&r1=937721&r2=937722&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java Sat Apr
24 23:26:20 2010
@@ -1256,24 +1256,29 @@ public class ApplicationContext
// {...@link
ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)}
// method of a {...@link ServletContextListener} that was not declared
// in web.xml, a web-fragment or annotated with {...@link WebListener}.
-
+
+ boolean match = false;
if (t instanceof ServletContextAttributeListener ||
t instanceof ServletRequestListener ||
t instanceof ServletRequestAttributeListener ||
t instanceof HttpSessionAttributeListener) {
context.addApplicationEventListener(t);
- return;
+ match = true;
}
if (t instanceof HttpSessionListener) {
context.addApplicationLifecycleListener(t);
+ match = true;
}
if (t instanceof ServletContextListener) {
// TODO SERVLET3 - also need to check caller? spec isn't clear
context.addApplicationLifecycleListener(t);
+ match = true;
}
+ if (match) return;
+
throw new IllegalArgumentException(sm.getString(
"applicationContext.addListener.iae.wrongType",
t.getClass().getName()));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]