Log mis-configuration in context.xml
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 13 Dec 2010 15:57:54 +0000 (15:57 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 13 Dec 2010 15:57:54 +0000 (15:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1045201 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/startup/ContextConfig.java
webapps/docs/changelog.xml

index a8237ea..2c5e5d1 100644 (file)
@@ -38,6 +38,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
+import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Properties;
@@ -519,6 +520,13 @@ public class ContextConfig
     protected Digester createContextDigester() {
         Digester digester = new Digester();
         digester.setValidating(false);
+        digester.setRulesValidation(true);
+        HashMap<Class<?>, List<String>> fakeAttributes =
+            new HashMap<Class<?>, List<String>>();
+        ArrayList<String> attrs = new ArrayList<String>();
+        attrs.add("className");
+        fakeAttributes.put(Object.class, attrs);
+        digester.setFakeAttributes(fakeAttributes);
         RuleSet contextRuleSet = new ContextRuleSet("", false);
         digester.addRuleSet(contextRuleSet);
         RuleSet namingRuleSet = new NamingRuleSet("Context/");
index 2aba539..69ce897 100644 (file)
         Ensure aliases settings for a context are retained after a context is
         reloaded. (markt)
       </fix>
+      <fix>
+        Log a warning if context.xml files define values for properties  that do
+        not exist (e.g. if there is a typo in a property name). (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">