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;
// 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);
}
// 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);
}
<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
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>