From: markt Date: Mon, 28 Dec 2009 22:12:06 +0000 (+0000) Subject: Revert r893208. Catalina does have a requirement to access the full jsp-property... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=aedb082f72d06cbb42f219158ea6f1924a921843;p=tomcat7.0 Revert r893208. Catalina does have a requirement to access the full jsp-property-group info git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@894258 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/deploy/JspPropertyGroup.java b/java/org/apache/catalina/deploy/JspPropertyGroup.java new file mode 100644 index 000000000..a208488dd --- /dev/null +++ b/java/org/apache/catalina/deploy/JspPropertyGroup.java @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +package org.apache.catalina.deploy; + +import java.util.LinkedHashSet; +import java.util.Set; + +/** + * Representation of a jsp-property-group element in web.xml. + */ +public class JspPropertyGroup { + private Boolean deferredSyntax = null; + public void setDeferredSyntax(String deferredSyntax) { + this.deferredSyntax = Boolean.valueOf(deferredSyntax); + } + public Boolean getDeferredSyntax() { return deferredSyntax; } + + private Boolean elIgnored = null; + public void setElIgnored(String elIgnored) { + this.elIgnored = Boolean.valueOf(elIgnored); + } + public Boolean getElIgnored() { return elIgnored; } + + private Set includeCodas = new LinkedHashSet(); + public void addIncludeCoda(String includeCoda) { + includeCodas.add(includeCoda); + } + public Set getIncludeCodas() { return includeCodas; } + + private Set includePreludes = new LinkedHashSet(); + public void addIncludePrelude(String includePrelude) { + includePreludes.add(includePrelude); + } + public Set getIncludePreludes() { return includePreludes; } + + private Boolean isXml = null; + public void setIsXml(String isXml) { + this.isXml = Boolean.valueOf(isXml); + } + public Boolean getIsXml() { return isXml; } + + private String pageEncoding = null; + public void setPageEncoding(String pageEncoding) { + this.pageEncoding = pageEncoding; + } + public String getPageEncoding() { return this.pageEncoding; } + + private Boolean scriptingInvalid = null; + public void setScriptingInvalid(String scriptingInvalid) { + this.scriptingInvalid = Boolean.valueOf(scriptingInvalid); + } + public Boolean getScriptingInvalid() { return scriptingInvalid; } + + private Boolean trimWhitespace = null; + public void setTrimWhitespace(String trimWhitespace) { + this.trimWhitespace = Boolean.valueOf(trimWhitespace); + } + public Boolean getTrimWhitespace() { return trimWhitespace; } + + private String urlPattern = null; + public void setUrlPattern(String urlPattern) { + this.urlPattern = urlPattern; + } + public String getUrlPattern() { return this.urlPattern; } + +} diff --git a/java/org/apache/catalina/startup/WebRuleSet.java b/java/org/apache/catalina/startup/WebRuleSet.java index dc4bd2bee..eab868c43 100644 --- a/java/org/apache/catalina/startup/WebRuleSet.java +++ b/java/org/apache/catalina/startup/WebRuleSet.java @@ -261,8 +261,29 @@ public class WebRuleSet extends RuleSetBase { digester.addRule(fullPrefix + "/jsp-config", jspConfig); + digester.addObjectCreate(fullPrefix + "/jsp-config/jsp-property-group", + "org.apache.catalina.deploy.JspPropertyGroup"); + digester.addSetNext(fullPrefix + "/jsp-config/jsp-property-group", + "addJspPropertyGroup", + "org.apache.catalina.deploy.JspPropertyGroup"); + digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/deferred-syntax-allowed-as-literal", + "setDeferredSyntax", 0); + digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/el-ignored", + "setElIgnored", 0); + digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/include-coda", + "addIncludeCoda", 0); + digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/include-prelude", + "addIncludePrelude", 0); + digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/is-xml", + "setIsXml", 0); + digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/page-encoding", + "setPageEncoding", 0); + digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/scripting-invalid", + "setScriptingInvalid", 0); + digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/trim-directive-whitespaces", + "setTrimWhitespace", 0); digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/url-pattern", - "addJspUrlPattern", 0); + "setUrlPattern", 0); digester.addRule(fullPrefix + "/login-config", loginConfig); diff --git a/java/org/apache/catalina/startup/WebXml.java b/java/org/apache/catalina/startup/WebXml.java index b8be7c21a..f258459e5 100644 --- a/java/org/apache/catalina/startup/WebXml.java +++ b/java/org/apache/catalina/startup/WebXml.java @@ -41,6 +41,7 @@ import org.apache.catalina.deploy.ContextService; import org.apache.catalina.deploy.ErrorPage; import org.apache.catalina.deploy.FilterDef; import org.apache.catalina.deploy.FilterMap; +import org.apache.catalina.deploy.JspPropertyGroup; import org.apache.catalina.deploy.LoginConfig; import org.apache.catalina.deploy.MessageDestination; import org.apache.catalina.deploy.MessageDestinationRef; @@ -275,15 +276,13 @@ public class WebXml { public Map getTaglibs() { return taglibs; } // jsp-config/jsp-property-group - // URL pattern is the only attribute Catalina needs to know. Jasper handles - // all the others - private Set jspUrlPatterns = - new HashSet(); - public void addJspUrlPattern(String urlPattern) { - jspUrlPatterns.add(urlPattern); + private Set jspPropertyGroups = + new HashSet(); + public void addJspPropertyGroup(JspPropertyGroup propertyGroup) { + jspPropertyGroups.add(propertyGroup); } - public Set getJspUrlPatterns() { - return jspUrlPatterns; + public Set getJspPropertyGroups() { + return jspPropertyGroups; } // security-constraint @@ -601,8 +600,8 @@ public class WebXml { } // Do this last as it depends on servlets - for (String urlPattern : jspUrlPatterns) { - context.addJspMapping(urlPattern); + for (JspPropertyGroup jspPropertyGroup : jspPropertyGroups) { + context.addJspMapping(jspPropertyGroup.getUrlPattern()); } } @@ -727,9 +726,9 @@ public class WebXml { filters.putAll(temp.getFilters()); for (WebXml fragment : fragments) { - for (String urlPattern : fragment.getJspUrlPatterns()) { + for (JspPropertyGroup jspPropertyGroup : fragment.getJspPropertyGroups()) { // Always additive - addJspUrlPattern(urlPattern); + addJspPropertyGroup(jspPropertyGroup); } }