You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2013/11/22 11:45:37 UTC

svn commit: r1544477 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/ java/org/apache/catalina/core/ java/org/apache/catalina/startup/ java/org/apache/jasper/ java/org/apache/jasper/compiler/ test/org/apache/catalina/core/ webapps/docs/config/

Author: markt
Date: Fri Nov 22 10:45:36 2013
New Revision: 1544477

URL: http://svn.apache.org/r1544477
Log: (empty)

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/Globals.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/FailedContext.java
    tomcat/tc7.0.x/trunk/java/org/apache/jasper/Constants.java
    tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java
    tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TesterContext.java
    tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1544460

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java?rev=1544477&r1=1544476&r2=1544477&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.java Fri Nov 22 10:45:36 2013
@@ -689,6 +689,24 @@ public interface Context extends Contain
 
 
     /**
+     * Will the parsing of *.jspx and *.tagx files for this Context be performed
+     * by a validating parser?
+     *
+     * @return true if validation is enabled.
+     */
+    public boolean getXmlValidationJspDoc();
+
+
+    /**
+     * Controls whether the parsing of *.jspx and *.tagx files for this Context
+     * will be performed by a validating parser.
+     *
+     * @param xmlValidationJspDoc true to enable xml validation
+     */
+    public void setXmlValidationJspDoc(boolean xmlValidationJspDoc);
+
+
+    /**
      * Get the Jar Scanner to be used to scan for JAR resources for this
      * context.
      * @return  The Jar Scanner configured for this context.

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/Globals.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/Globals.java?rev=1544477&r1=1544476&r2=1544477&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/Globals.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/Globals.java Fri Nov 22 10:45:36 2013
@@ -310,10 +310,20 @@ public final class Globals {
 
     /**
      * Name of the ServletContext attribute that determines if the JSP engine
-     * should validate *.tld, *.jspx and *.tagx files when parsing them.
+     * should validate *.tld files when parsing them.
      * <p>
      * This must be kept in sync with org.apache.japser.Constants
      */
     public static final String JASPER_XML_VALIDATION_ATTR =
             "org.apache.jasper.XML_VALIDATE";
+
+
+    /**
+     * Name of the ServletContext attribute that determines if the JSP engine
+     * should validate *.jspx and *.tagx files when parsing them.
+     * <p>
+     * This must be kept in sync with org.apache.japser.Constants
+     */
+    public static final String JASPER_XML_VALIDATION_DOC_ATTR =
+            "org.apache.jasper.XML_VALIDATE_DOC";
 }

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1544477&r1=1544476&r2=1544477&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardContext.java Fri Nov 22 10:45:36 2013
@@ -732,6 +732,13 @@ public class StandardContext extends Con
 
 
     /**
+     * Attribute value used to turn on/off XML validation for *.jspx and *.tagx
+     * files.
+     */
+    private boolean xmlValidationJspDoc = false;
+
+
+    /**
      * Attribute value used to turn on/off XML namespace validation
      */
     private boolean webXmlNamespaceAware = Globals.STRICT_SERVLET_COMPLIANCE;
@@ -6630,6 +6637,18 @@ public class StandardContext extends Con
         return tldValidation;
     }
 
+
+    @Override
+    public void setXmlValidationJspDoc(boolean webXmlValidationJspDoc){
+        this.xmlValidationJspDoc = webXmlValidationJspDoc;
+    }
+
+
+    @Override
+    public boolean getXmlValidationJspDoc(){
+        return xmlValidationJspDoc;
+    }
+
     
     /**
      * Sets the process TLDs attribute.

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/FailedContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/FailedContext.java?rev=1544477&r1=1544476&r2=1544477&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/FailedContext.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/FailedContext.java Fri Nov 22 10:45:36 2013
@@ -436,6 +436,11 @@ public class FailedContext extends Lifec
     public void setTldNamespaceAware(boolean tldNamespaceAware) { /* NO-OP */ }
 
     @Override
+    public boolean getXmlValidationJspDoc() { return false; }
+    @Override
+    public void setXmlValidationJspDoc(boolean xmlValidationJspDoc) { /* NO-OP */ }
+
+    @Override
     public JarScanner getJarScanner() { return null; }
     @Override
     public void setJarScanner(JarScanner jarScanner) { /* NO-OP */ }

Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/Constants.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/Constants.java?rev=1544477&r1=1544476&r2=1544477&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/Constants.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/Constants.java Fri Nov 22 10:45:36 2013
@@ -235,9 +235,18 @@ public class Constants {
 
     /**
      * Name of the ServletContext attribute that determines if the XML parsers
-     * used for *.tld, *.jspx and *.tagx files will be validating or not.
+     * used for *.tld files will be validating or not.
      * <p>
      * This must be kept in sync with org.apache.catalina.Globals
      */
     public static final String XML_VALIDATION_ATTR = "org.apache.jasper.XML_VALIDATE";
+
+
+    /**
+     * Name of the ServletContext attribute that determines if the XML parsers
+     * used for *.jspx and *.tagx files will be validating or not.
+     * <p>
+     * This must be kept in sync with org.apache.catalina.Globals
+     */
+    public static final String XML_VALIDATION_DOC_ATTR = "org.apache.jasper.XML_VALIDATE_DOC";
 }

Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java?rev=1544477&r1=1544476&r2=1544477&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java Fri Nov 22 10:45:36 2013
@@ -165,7 +165,7 @@ class JspDocumentParser
 
             boolean validate = Boolean.parseBoolean(
                     pc.getJspCompilationContext().getServletContext().getInitParameter(
-                            Constants.XML_VALIDATION_ATTR));
+                            Constants.XML_VALIDATION_DOC_ATTR));
             jspDocParser.isValidating = validate;
 
             // Parse the input

Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TesterContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TesterContext.java?rev=1544477&r1=1544476&r2=1544477&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TesterContext.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TesterContext.java Fri Nov 22 10:45:36 2013
@@ -571,6 +571,16 @@ public class TesterContext implements Co
     }
 
     @Override
+    public boolean getXmlValidationJspDoc() {
+        return false;
+    }
+
+    @Override
+    public void setXmlValidationJspDoc(boolean xmlValidationJspDoc) {
+       // NO-OP
+    }
+
+    @Override
     public void setXmlValidation(boolean xmlValidation) {
         // NO-OP
     }

Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml?rev=1544477&r1=1544476&r2=1544477&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/config/context.xml Fri Nov 22 10:45:36 2013
@@ -555,10 +555,12 @@
 
       <attribute name="xmlValidation" required="false">
         <p>If the value of this flag is <code>true</code>, the parsing of
-        <code>web.xml</code>, <code>web-fragment.xml</code>, <code>*.tld</code>,
-        <code>*.jspx</code> and <code>*.tagx</code> files for this web
-        application will use a validating parser. Note that the
-        <code>tagPlugins.xml</code> file (if any) is never parsed using a
+        <code>web.xml</code>, <code>web-fragment.xml</code> and
+        <code>*.tld</code> files for this web application will use a validating
+        parser. Note that validation of <code>*.jspx</code> and
+        <code>*.tagx</code> files is controlled separately by the
+        <strong>xmlValidationJspDoc</strong> attribute and that
+        <code>tagPlugins.xml</code> files (if any) are never parsed using a
         validating parser. If the
         <code>org.apache.catalina.STRICT_SERVLET_COMPLIANCE</code>
         <a href="systemprops.html">system property</a> is set to
@@ -568,6 +570,15 @@
         penalty.</p>
       </attribute>
 
+      <attribute name="xmlValidationJspDoc" required="false">
+        <p>If the value of this flag is <code>true</code>, the parsing of
+        <code>*.jspx</code> and <code>*.tagx</code> files for this web
+        application will use a validating parser. Before enabling this option
+        users should review section JSP.6.2.4 of the JSP 2.3 specification. The
+        default value will be <code>false</code>. Setting this attribute to
+        <code>true</code> will incur a performance penalty.</p>
+      </attribute>
+
 
     </attributes>
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org