Author: markt
Date: Sun Jun 6 18:47:14 2010
New Revision: 951926
URL: http://svn.apache.org/viewvc?rev=951926&view=rev
Log:
Part of refactoring STRICT_SERVLET_COMPLIANCE so it just changes defaults
New WRAP_SAME_OBJECT property
Modified:
tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
tomcat/trunk/webapps/docs/config/systemprops.xml
Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java?rev=951926&r1=951925&r2=951926&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java Sun
Jun 6 18:47:14 2010
@@ -70,6 +70,25 @@ final class ApplicationDispatcher
private static final Log log =
LogFactory.getLog(ApplicationDispatcher.class);
+ protected static final boolean STRICT_SERVLET_COMPLIANCE;
+
+ protected static final boolean WRAP_SAME_OBJECT;
+
+
+ static {
+ STRICT_SERVLET_COMPLIANCE = Globals.STRICT_SERVLET_COMPLIANCE;
+
+ String wrapSameObject = System.getProperty(
+
"org.apache.catalina.core.ApplicationDispatcher.WRAP_SAME_OBJECT");
+ if (wrapSameObject == null) {
+ WRAP_SAME_OBJECT = STRICT_SERVLET_COMPLIANCE;
+ } else {
+ WRAP_SAME_OBJECT =
+ Boolean.valueOf(wrapSameObject).booleanValue();
+ }
+ }
+
+
protected class PrivilegedForward
implements PrivilegedExceptionAction<Void> {
private ServletRequest request;
@@ -329,7 +348,7 @@ final class ApplicationDispatcher
// Set up to handle the specified request and response
State state = new State(request, response, false);
- if (Globals.STRICT_SERVLET_COMPLIANCE) {
+ if (WRAP_SAME_OBJECT) {
// Check SRV.8.2 / SRV.14.2.5.1 compliance
checkSameObjects(request, response);
}
@@ -504,7 +523,7 @@ final class ApplicationDispatcher
// Set up to handle the specified request and response
State state = new State(request, response, true);
- if (Globals.STRICT_SERVLET_COMPLIANCE) {
+ if (WRAP_SAME_OBJECT) {
// Check SRV.8.2 / SRV.14.2.5.1 compliance
checkSameObjects(request, response);
}
Modified: tomcat/trunk/webapps/docs/config/systemprops.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/systemprops.xml?rev=951926&r1=951925&r2=951926&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/systemprops.xml (original)
+++ tomcat/trunk/webapps/docs/config/systemprops.xml Sun Jun 6 18:47:14 2010
@@ -222,31 +222,23 @@
<properties>
<property name="org.apache.catalina. STRICT_SERVLET_COMPLIANCE">
- <p>If this is <code>true</code> the following actions will occur:
+ <p>If this is <code>true</code> the default values will be changed for:
<ul>
- <li>any wrapped request or response object passed to an application
- dispatcher will be checked to ensure that it has wrapped the original
- request or response. (SRV.8.2 / SRV.14.2.5.1)
- </li>
- <li>
- The default value will be changed for:
- <ul>
-
<li><code>org.apache.catalina.core.ApplicationContext.GET_RESOURCE_REQUIRE_SLASH</code></li>
-
<li><code>org.apache.catalina.core.StandardHostValve.ACCESS_SESSION</code></li>
-
<li><code>org.apache.catalina.session.StandardSession.ACTIVITY_CHECK</code></li>
-
<li><code>org.apache.tomcat.util.http.ServerCookie.ALWAYS_ADD_EXPIRES</code>.</li>
-
<li><code>org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR</code>.</li>
-
<li><code>org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING</code>.</li>
- <li>The <code>tldNamespaceAware</code> attribute of any
- <a href="context.html">Context</a> element</li>.
- <li>The <code>tldValidation</code> attribute of any
- <a href="context.html">Context</a> element</li>.
- <li>The <code>xmlNamespaceAware</code> attribute of any
- <a href="context.html">Context</a> element</li>.
- <li>The <code>xmlValidation</code> attribute of any
- <a href="context.html">Context</a> element</li>.
- </ul>
- </li>
+
<li><code>org.apache.catalina.core.ApplicationContext.GET_RESOURCE_REQUIRE_SLASH</code></li>
+
<li><code>org.apache.catalina.core.ApplicationDispatcher.WRAP_SAME_OBJECT</code></li>
+
<li><code>org.apache.catalina.core.StandardHostValve.ACCESS_SESSION</code></li>
+
<li><code>org.apache.catalina.session.StandardSession.ACTIVITY_CHECK</code></li>
+
<li><code>org.apache.tomcat.util.http.ServerCookie.ALWAYS_ADD_EXPIRES</code>.</li>
+
<li><code>org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR</code>.</li>
+
<li><code>org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING</code>.</li>
+ <li>The <code>tldNamespaceAware</code> attribute of any
+ <a href="context.html">Context</a> element</li>.
+ <li>The <code>tldValidation</code> attribute of any
+ <a href="context.html">Context</a> element</li>.
+ <li>The <code>xmlNamespaceAware</code> attribute of any
+ <a href="context.html">Context</a> element</li>.
+ <li>The <code>xmlValidation</code> attribute of any
+ <a href="context.html">Context</a> element</li>.
</ul>
</p>
<p>Note that changing a number of the above defaults is likely to break
@@ -282,6 +274,15 @@
else the default value will be <code>false</code>.</p>
</property>
+ <property name="org.apache.catalina.core.
ApplicationDispatcher.WRAP_SAME_OBJECT">
+ <p>If this is <code>true</code> then any wrapped request or response
+ object passed to an application dispatcher will be checked to ensure that
+ it has wrapped the original request or response. If
+ <code>org.apache.catalina.STRICT_SERVLET_COMPLIANCE</code> is set to
+ <code>true</code>, the default of this setting will be <code>true</code>,
+ else the default value will be <code>false</code>.</p>
+ </property>
+
<property
name="org.apache.tomcat.util.http. ServerCookie.ALLOW_EQUALS_IN_VALUE">
<p>If this is <code>true</code> Tomcat will allow <code>=</code>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]