Unlikely, but handle it in case.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 13 Sep 2009 18:27:37 +0000 (18:27 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 13 Sep 2009 18:27:37 +0000 (18:27 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@814377 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/startup/LocalStrings.properties
java/org/apache/catalina/startup/WebXmlCommon.java

index 4dc0cad..cadc30e 100644 (file)
@@ -116,4 +116,5 @@ webXmlCommon.duplicateMessageDestination=Duplicate message-destination name
 webXmlCommon.duplicateMessageDestinationRef=Duplicate message-destination-ref name
 webXmlCommon.duplicateResourceEnvRef=Duplicate resource-env-ref name
 webXmlCommon.duplicateResourceRef=Duplicate resource-ref name
+webXmlCommon.reservedName=A web.xml file was detected using a reserved name [{0}]. The name element will be ignored for this fragment.
 webXmlFragment.multipleOther=Multiple others entries in ordering
index 3dfe53c..05570e4 100644 (file)
@@ -57,6 +57,9 @@ public abstract class WebXmlCommon {
     protected static final StringManager sm =
         StringManager.getManager(Constants.Package);
 
+    private static org.apache.juli.logging.Log log=
+        org.apache.juli.logging.LogFactory.getLog(WebXmlCommon.class);
+    
     // Required attribute of web-app element
     private String version = null;
     public String getVersion() { return version; }
@@ -71,7 +74,14 @@ public abstract class WebXmlCommon {
     // Optional name element
     private String name = null;
     public String getName() { return name; }
-    public void setName(String name) { this.name = name; }
+    public void setName(String name) {
+        if (ORDER_OTHERS.equalsIgnoreCase(name)) {
+            // This is unusual. This name will be ignored. Log the fact.
+            log.warn(sm.getString("webXmlCommon.reservedName", name));
+        } else {
+            this.name = name;
+        }
+    }
 
     // web-app elements
     // TODO: Ignored elements: