From fceff3cbbeaa5d32dec923a90385687b5d5e8908 Mon Sep 17 00:00:00 2001 From: markt Date: Tue, 21 Jun 2011 11:10:47 +0000 Subject: [PATCH] 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 --- java/org/apache/catalina/startup/WebRuleSet.java | 10 +++------- webapps/docs/changelog.xml | 6 ++++++ 2 files changed, 9 insertions(+), 7 deletions(-) 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) + -- 2.11.0