SRV 6.2.5 says supporting for '*' as the servlet-name in filter-mapping.
authorpero <pero@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 15 Sep 2007 07:55:42 +0000 (07:55 +0000)
committerpero <pero@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 15 Sep 2007 07:55:42 +0000 (07:55 +0000)
    <filter-mapping>
        <filter-name>SampleFilter</filter-name>
        <servlet-name>*</servlet-name>
    </filter-mapping>

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@575890 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/StandardContext.java
webapps/docs/changelog.xml

index b5b2184..3f893c0 100644 (file)
@@ -2156,7 +2156,13 @@ public class StandardContext
         if (findFilterDef(filterName) == null)
             throw new IllegalArgumentException
                 (sm.getString("standardContext.filterMap.name", filterName));
-        if ((servletNames.length == 0) && (urlPatterns.length == 0))
+//      <= Servlet API 2.4
+//      if ((servletNames.length == 0) && (urlPatterns.length == 0))
+//      Servlet API 2.5 (FIX 43338)
+//      SRV 6.2.5 says supporting for '*' as the servlet-name in filter-mapping.
+        if (!filterMap.getMatchAllServletNames() && 
+            !filterMap.getMatchAllUrlPatterns() && 
+            (servletNames.length == 0) && (urlPatterns.length == 0))
             throw new IllegalArgumentException
                 (sm.getString("standardContext.filterMap.either"));
         // FIXME: Older spec revisions may still check this
index 1a226bb..2f5b1b7 100644 (file)
       </update>
       <fix>
         o.a.juli.ClassLoaderLogManager handle more then one system property replacement at file logging.properties. (pero)
-      </fix>     
+      </fix>
+      <fix>
+        <bug>43338</bug>: Support '*' servlet-name mapping at filter-mapping.
+        Patch provided by Keiichi Fujino. (pero)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">