Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51401
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 21 Jun 2011 11:10:47 +0000 (11:10 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 21 Jun 2011 11:10:47 +0000 (11:10 +0000)
Correctly initialise shared WebRuleSet instance used by the digesters that parse web.xml and prevent incorrect warnings about multiple occurrences of elements that are only allowed to appear once in web.xml and web-fragment.xml.
Patch by kfujino

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

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

index 9561765..b05daaa 100644 (file)
@@ -77,19 +77,19 @@ public class WebRuleSet extends RuleSetBase {
     /**
      * The <code>SetSessionConfig</code> rule used to parse the web.xml
      */
-    protected SetSessionConfig sessionConfig;
+    protected SetSessionConfig sessionConfig = new SetSessionConfig();
     
     
     /**
      * The <code>SetLoginConfig</code> rule used to parse the web.xml
      */
-    protected SetLoginConfig loginConfig;
+    protected SetLoginConfig loginConfig = new SetLoginConfig();
 
     
     /**
      * The <code>SetJspConfig</code> rule used to parse the web.xml
      */    
-    protected SetJspConfig jspConfig;
+    protected SetJspConfig jspConfig = new SetJspConfig();
 
 
     // ------------------------------------------------------------ Constructor
@@ -153,10 +153,6 @@ public class WebRuleSet extends RuleSetBase {
      */
     @Override
     public void addRuleInstances(Digester digester) {
-        sessionConfig = new SetSessionConfig();
-        jspConfig = new SetJspConfig();
-        loginConfig = new SetLoginConfig();
-        
         digester.addRule(fullPrefix,
                          new SetPublicIdRule("setPublicId"));
         digester.addRule(fullPrefix,
index 219c98c..e07367f 100644 (file)
         <bug>51396</bug>: Correctly handle jsp-file entries in web.xml when the
         JSP servlet has been configured via code when embedding Tomcat. (markt)
       </fix>
+      <fix>
+        <bug>51401</bug>: Correctly initialise shared WebRuleSet instance used
+        by the digesters that parse web.xml and prevent incorrect warnings about
+        multiple occurrences of elements that are only allowed to appear once in
+        web.xml and web-fragment.xml. (kfujino)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">