From: markt Date: Tue, 21 Jun 2011 11:10:47 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51401 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=fceff3cbbeaa5d32dec923a90385687b5d5e8908;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51401 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 --- diff --git a/java/org/apache/catalina/startup/WebRuleSet.java b/java/org/apache/catalina/startup/WebRuleSet.java index 9561765f5..b05daaac0 100644 --- a/java/org/apache/catalina/startup/WebRuleSet.java +++ b/java/org/apache/catalina/startup/WebRuleSet.java @@ -77,19 +77,19 @@ public class WebRuleSet extends RuleSetBase { /** * The SetSessionConfig rule used to parse the web.xml */ - protected SetSessionConfig sessionConfig; + protected SetSessionConfig sessionConfig = new SetSessionConfig(); /** * The SetLoginConfig rule used to parse the web.xml */ - protected SetLoginConfig loginConfig; + protected SetLoginConfig loginConfig = new SetLoginConfig(); /** * The SetJspConfig 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, diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 219c98c87..e07367f16 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -106,6 +106,12 @@ 51396: Correctly handle jsp-file entries in web.xml when the JSP servlet has been configured via code when embedding Tomcat. (markt) + + 51401: 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) +