// ----------------------------------------------------------- Constructors
+ /**
+ * Compliance with SRV.15.2.22.1. A call to Response.getWriter() if no
+ * character encoding has been specified will result in subsequent calls to
+ * Response.getCharacterEncoding() returning ISO-8859-1 and the Content-Type
+ * response header will include a charset=ISO-8859-1 component.
+ */
+ private static final boolean ENFORCE_ENCODING_IN_GET_WRITER;
+
static {
// Ensure that URL is loaded for SM
URL.isSchemeChar('c');
+
+ ENFORCE_ENCODING_IN_GET_WRITER = Boolean.valueOf(
+ System.getProperty("org.apache.catalina.connector.Response.ENFORCE_ENCODING_IN_GET_WRITER",
+ "true")).booleanValue();
}
public Response() {
throw new IllegalStateException
(sm.getString("coyoteResponse.getWriter.ise"));
- if (Globals.STRICT_SERVLET_COMPLIANCE) {
+ if (ENFORCE_ENCODING_IN_GET_WRITER) {
/*
* If the response's character encoding has not been specified as
* described in <code>getCharacterEncoding</code> (i.e., the method
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>a call to <code>Response.getWriter()</code> if no character encoding
- has been specified will result in subsequent calls to
- <code>Response.getCharacterEncoding()</code> returning
- <code>ISO-8859-1</code> and the <code>Content-Type</code> response header
- will include a <code>charset=ISO-8859-1</code> component. (SRV.15.2.22.1)
- </li>
<li>every request that is associated with a session will cause the
session's last accessed time to be updated regardless of whether or not
the request explicitly accesses the session. (SRV.7.6)
overridden by explicitly setting the appropriate system property.</p>
</property>
+ <property name="org.apache.catalina.connector. Response.ENFORCE_ENCODING_IN_GET_WRITER">
+ <p>If this is <code>true</code> then
+ a call to <code>Response.getWriter()</code> if no character encoding
+ has been specified will result in subsequent calls to
+ <code>Response.getCharacterEncoding()</code> returning
+ <code>ISO-8859-1</code> and the <code>Content-Type</code> response header
+ will include a <code>charset=ISO-8859-1</code> component. (SRV.15.2.22.1)
+ <br />
+ If not specified, the default specification compliant value of
+ <code>true</code> will be used.</p>
+ </property>
+
<property
name="org.apache.catalina.session. StandardSession.ACTIVITY_CHECK">
<p>If this is <code>true</code> or if