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 12:11:56 UTC
svn commit: r1544487 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/
java/org/apache/catalina/core/ java/org/apache/catalina/startup/
test/org/apache/catalina/core/ webapps/docs/
Author: markt
Date: Fri Nov 22 11:11:56 2013
New Revision: 1544487
URL: http://svn.apache.org/r1544487
Log:
Always use a namespace aware parser for TLD files.
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.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/catalina/startup/TldConfig.java
tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TesterContext.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
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=1544487&r1=1544486&r2=1544487&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 11:11:56 2013
@@ -653,20 +653,24 @@ public interface Context extends Contain
/**
- * Will the parsing of *.tld files for this Context be performed by a
- * namespace aware parser?
+ * *.tld files are always parsed using a namespace aware parser.
*
- * @return true if namespace awareness is enabled.
+ * @return Always <code>true</true>
+ *
+ * @deprecated This option will be removed in 8.0.x.
*/
+ @Deprecated
public boolean getTldNamespaceAware();
/**
- * Controls whether the parsing of *.tld files for this Context will be
- * performed by a namespace aware parser.
+ * *.tld files are always parsed using a namespace aware parser.
*
- * @param tldNamespaceAware true to enable namespace awareness
+ * @param tldNamespaceAware ignored
+ *
+ * @deprecated
*/
+ @Deprecated
public void setTldNamespaceAware(boolean tldNamespaceAware);
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=1544487&r1=1544486&r2=1544487&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 11:11:56 2013
@@ -755,12 +755,6 @@ public class StandardContext extends Con
/**
- * Attribute value used to turn on/off TLD XML namespace validation
- */
- private boolean tldNamespaceAware = Globals.STRICT_SERVLET_COMPLIANCE;
-
-
- /**
* Should we save the configuration.
*/
private boolean saveConfig = true;
@@ -6616,13 +6610,13 @@ public class StandardContext extends Con
@Override
public boolean getTldNamespaceAware(){
- return tldNamespaceAware;
+ return true;
}
@Override
public void setTldNamespaceAware(boolean tldNamespaceAware){
- this.tldNamespaceAware = tldNamespaceAware;
+ // NO-OP;
}
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=1544487&r1=1544486&r2=1544487&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 11:11:56 2013
@@ -431,7 +431,7 @@ public class FailedContext extends Lifec
public boolean getTldValidation() { return false; }
@Override
- public boolean getTldNamespaceAware() { return false; }
+ public boolean getTldNamespaceAware() { return true; }
@Override
public void setTldNamespaceAware(boolean tldNamespaceAware) { /* NO-OP */ }
Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java?rev=1544487&r1=1544486&r2=1544487&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java Fri Nov 22 11:11:56 2013
@@ -77,44 +77,29 @@ public final class TldConfig implements
/**
* The <code>Digester</code>s available to process tld files.
*/
- private static Digester[] tldDigesters = new Digester[4];
+ private static Digester[] tldDigesters = new Digester[2];
/**
* Create (if necessary) and return a Digester configured to process the
* tld.
*/
- private static Digester createTldDigester(boolean namespaceAware,
- boolean validation) {
+ private static Digester createTldDigester(boolean validation) {
Digester digester = null;
- if (!namespaceAware && !validation) {
+ if (!validation) {
if (tldDigesters[0] == null) {
tldDigesters[0] = DigesterFactory.newDigester(validation,
- namespaceAware, new TldRuleSet());
+ true, new TldRuleSet());
tldDigesters[0].getParser();
}
digester = tldDigesters[0];
- } else if (!namespaceAware && validation) {
+ } else {
if (tldDigesters[1] == null) {
tldDigesters[1] = DigesterFactory.newDigester(validation,
- namespaceAware, new TldRuleSet());
+ true, new TldRuleSet());
tldDigesters[1].getParser();
}
digester = tldDigesters[1];
- } else if (namespaceAware && !validation) {
- if (tldDigesters[2] == null) {
- tldDigesters[2] = DigesterFactory.newDigester(validation,
- namespaceAware, new TldRuleSet());
- tldDigesters[2].getParser();
- }
- digester = tldDigesters[2];
- } else {
- if (tldDigesters[3] == null) {
- tldDigesters[3] = DigesterFactory.newDigester(validation,
- namespaceAware, new TldRuleSet());
- tldDigesters[3].getParser();
- }
- digester = tldDigesters[3];
}
return digester;
}
@@ -580,8 +565,7 @@ public final class TldConfig implements
private void init() {
if (tldDigester == null){
- tldDigester = createTldDigester(context.getTldNamespaceAware(),
- context.getTldValidation());
+ tldDigester = createTldDigester(context.getTldValidation());
}
}
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=1544487&r1=1544486&r2=1544487&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 11:11:56 2013
@@ -602,7 +602,7 @@ public class TesterContext implements Co
@Override
public boolean getTldNamespaceAware() {
- return false;
+ return true;
}
@Override
Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1544487&r1=1544486&r2=1544487&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Fri Nov 22 11:11:56 2013
@@ -149,6 +149,12 @@
more than one data message may be sent to a remote WebSocket endpoint at
a time. (markt)
</fix>
+ <fix>
+ When Catalina parses TLD files, always use a namespace aware parser to
+ be consistent with how Jasper parses TLD files. The
+ <code>tldNamespaceAware</code> attribute of the Context is now ignored.
+ (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r1544487 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/
java/org/apache/catalina/core/ java/org/apache/catalina/startup/ test/org/apache/catalina/core/
webapps/docs/
Posted by Mark Thomas <ma...@apache.org>.
On 22/11/2013 12:31, Konstantin Kolinko wrote:
> I think you have to update documentation on this attribute in
> docs/config/context.xml.
>
> It is also mentioned in docs/config/systemprops.xml as one of the
> attributes changed by "strict compliance" option.
Thanks.
Fixed.
Mark
>
> 2013/11/22 <ma...@apache.org>:
>> Author: markt
>> Date: Fri Nov 22 11:11:56 2013
>> New Revision: 1544487
>>
>> URL: http://svn.apache.org/r1544487
>> Log:
>> Always use a namespace aware parser for TLD files.
>>
>> Modified:
>> tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.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/catalina/startup/TldConfig.java
>> tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TesterContext.java
>> tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
>>
>
>> @@ -6616,13 +6610,13 @@ public class StandardContext extends Con
>>
>> @Override
>> public boolean getTldNamespaceAware(){
>> - return tldNamespaceAware;
>> + return true;
>> }
>>
>>
>> @Override
>> public void setTldNamespaceAware(boolean tldNamespaceAware){
>> - this.tldNamespaceAware = tldNamespaceAware;
>> + // NO-OP;
>> }
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r1544487 - in /tomcat/tc7.0.x/trunk:
java/org/apache/catalina/ java/org/apache/catalina/core/ java/org/apache/catalina/startup/
test/org/apache/catalina/core/ webapps/docs/
Posted by Konstantin Kolinko <kn...@gmail.com>.
I think you have to update documentation on this attribute in
docs/config/context.xml.
It is also mentioned in docs/config/systemprops.xml as one of the
attributes changed by "strict compliance" option.
2013/11/22 <ma...@apache.org>:
> Author: markt
> Date: Fri Nov 22 11:11:56 2013
> New Revision: 1544487
>
> URL: http://svn.apache.org/r1544487
> Log:
> Always use a namespace aware parser for TLD files.
>
> Modified:
> tomcat/tc7.0.x/trunk/java/org/apache/catalina/Context.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/catalina/startup/TldConfig.java
> tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TesterContext.java
> tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
>
> @@ -6616,13 +6610,13 @@ public class StandardContext extends Con
>
> @Override
> public boolean getTldNamespaceAware(){
> - return tldNamespaceAware;
> + return true;
> }
>
>
> @Override
> public void setTldNamespaceAware(boolean tldNamespaceAware){
> - this.tldNamespaceAware = tldNamespaceAware;
> + // NO-OP;
> }
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org