Revert r893208. Catalina does have a requirement to access the full jsp-property...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 28 Dec 2009 22:12:06 +0000 (22:12 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 28 Dec 2009 22:12:06 +0000 (22:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@894258 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/deploy/JspPropertyGroup.java [new file with mode: 0644]
java/org/apache/catalina/startup/WebRuleSet.java
java/org/apache/catalina/startup/WebXml.java

diff --git a/java/org/apache/catalina/deploy/JspPropertyGroup.java b/java/org/apache/catalina/deploy/JspPropertyGroup.java
new file mode 100644 (file)
index 0000000..a208488
--- /dev/null
@@ -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<String> includeCodas = new LinkedHashSet<String>();
+    public void addIncludeCoda(String includeCoda) {
+        includeCodas.add(includeCoda);
+    }
+    public Set<String> getIncludeCodas() { return includeCodas; }
+
+    private Set<String> includePreludes = new LinkedHashSet<String>();
+    public void addIncludePrelude(String includePrelude) {
+        includePreludes.add(includePrelude);
+    }
+    public Set<String> 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; }
+    
+}
index dc4bd2b..eab868c 100644 (file)
@@ -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);
index b8be7c2..f258459 100644 (file)
@@ -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<String,String> 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<String> jspUrlPatterns =
-        new HashSet<String>();
-    public void addJspUrlPattern(String urlPattern) {
-        jspUrlPatterns.add(urlPattern);
+    private Set<JspPropertyGroup> jspPropertyGroups =
+        new HashSet<JspPropertyGroup>();
+    public void addJspPropertyGroup(JspPropertyGroup propertyGroup) {
+        jspPropertyGroups.add(propertyGroup);
     }
-    public Set<String> getJspUrlPatterns() {
-        return jspUrlPatterns;
+    public Set<JspPropertyGroup> 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);
             }
         }