Author: remy.maucherat(a)jboss.com
Date: 2009-11-25 11:00:22 -0500 (Wed, 25 Nov 2009)
New Revision: 1293
Modified:
trunk/java/org/apache/catalina/startup/ContextConfig.java
Log:
- Also look at the annotation value.
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-11-25 15:20:31 UTC (rev
1292)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-11-25 16:00:22 UTC (rev
1293)
@@ -450,12 +450,12 @@
context.addFilterDef(filterDef);
FilterMap filterMap = new FilterMap();
filterMap.setFilterName(filterName);
- String[] urlPatterns = annotation.urlPatterns();
- if (urlPatterns != null) {
- for (int i = 0; i < urlPatterns.length; i++) {
- filterMap.addURLPattern(urlPatterns[i]);
- }
+ for (String urlPattern : annotation.urlPatterns()) {
+ filterMap.addURLPattern(urlPattern);
}
+ for (String urlPattern : annotation.value()) {
+ filterMap.addURLPattern(urlPattern);
+ }
String[] servletNames = annotation.servletNames();
if (servletNames != null) {
for (int i = 0; i < servletNames.length; i++) {
@@ -482,12 +482,12 @@
wrapper.addInitParameter(params[i].name(), params[i].value());
}
context.addChild(wrapper);
- String[] urlPatterns = annotation.urlPatterns();
- if (urlPatterns != null) {
- for (int i = 0; i < urlPatterns.length; i++) {
- context.addServletMapping(urlPatterns[i], annotation.name());
- }
+ for (String urlPattern : annotation.urlPatterns()) {
+ context.addServletMapping(urlPattern, annotation.name());
}
+ for (String urlPattern : annotation.value()) {
+ context.addServletMapping(urlPattern, annotation.name());
+ }
}
if (clazz.isAnnotationPresent(WebListener.class)) {
// Add listener
Show replies by date