Author: remm Date: Wed Feb 7 14:53:07 2007 New Revision: 504726 URL: http://svn.apache.org/viewvc?view=rev&rev=504726 Log: - 41521: Support * for servlet-name, submitted by Paul McMahan.
Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterFactory.java tomcat/tc6.0.x/trunk/java/org/apache/catalina/deploy/FilterMap.java Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterFactory.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterFactory.java?view=diff&rev=504726&r1=504725&r2=504726 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterFactory.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/ApplicationFilterFactory.java Wed Feb 7 14:53:07 2007 @@ -234,7 +234,7 @@ // Check the specific "*" special URL pattern, which also matches // named dispatches - if (filterMap.getAllMatch()) + if (filterMap.getMatchAllUrlPatterns()) return (true); if (requestPath == null) @@ -319,6 +319,10 @@ if (servletName == null) { return (false); + } + // Check the specific "*" special servlet name + else if (filterMap.getMatchAllServletNames()) { + return (true); } else { String[] servletNames = filterMap.getServletNames(); for (int i = 0; i < servletNames.length; i++) { Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/deploy/FilterMap.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/deploy/FilterMap.java?view=diff&rev=504726&r1=504725&r2=504726 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/deploy/FilterMap.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/deploy/FilterMap.java Wed Feb 7 14:53:07 2007 @@ -87,24 +87,38 @@ } public void addServletName(String servletName) { - String[] results = new String[servletNames.length + 1]; - System.arraycopy(servletNames, 0, results, 0, servletNames.length); - results[servletNames.length] = servletName; - servletNames = results; + if ("*".equals(servletName)) { + this.matchAllServletNames = true; + } else { + String[] results = new String[servletNames.length + 1]; + System.arraycopy(servletNames, 0, results, 0, servletNames.length); + results[servletNames.length] = servletName; + servletNames = results; + } } /** - * The flag that indicates this mapping will match all. + * The flag that indicates this mapping will match all url-patterns */ - private boolean allMatch = false; + private boolean matchAllUrlPatterns = false; - public boolean getAllMatch() { - return allMatch; + public boolean getMatchAllUrlPatterns() { + return matchAllUrlPatterns; } /** + * The flag that indicates this mapping will match all servlet-names + */ + private boolean matchAllServletNames = false; + + public boolean getMatchAllServletNames() { + return matchAllServletNames; + } + + + /** * The URL pattern this mapping matches. */ private String[] urlPatterns = new String[0]; @@ -115,7 +129,7 @@ public void addURLPattern(String urlPattern) { if ("*".equals(urlPattern)) { - this.allMatch = true; + this.matchAllUrlPatterns = true; } else { String[] results = new String[urlPatterns.length + 1]; System.arraycopy(urlPatterns, 0, results, 0, urlPatterns.length); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]