You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2006/09/27 20:10:10 UTC
svn commit: r450530 -
/tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java
Author: remm
Date: Wed Sep 27 11:10:09 2006
New Revision: 450530
URL: http://svn.apache.org/viewvc?view=rev&rev=450530
Log:
- Take advantage of the compliance flag to add back forceful appending of the charset (for people who really wish to get
in trouble).
Modified:
tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java
Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java?view=diff&rev=450530&r1=450529&r2=450530
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java Wed Sep 27 11:10:09 2006
@@ -38,6 +38,7 @@
import javax.servlet.http.HttpServletResponse;
import org.apache.catalina.Context;
+import org.apache.catalina.Globals;
import org.apache.catalina.Session;
import org.apache.catalina.Wrapper;
import org.apache.catalina.security.SecurityUtil;
@@ -601,6 +602,22 @@
if (usingOutputStream)
throw new IllegalStateException
(sm.getString("coyoteResponse.getWriter.ise"));
+
+ if (Globals.STRICT_SERVLET_COMPLIANCE) {
+ /*
+ * If the response's character encoding has not been specified as
+ * described in <code>getCharacterEncoding</code> (i.e., the method
+ * just returns the default value <code>ISO-8859-1</code>),
+ * <code>getWriter</code> updates it to <code>ISO-8859-1</code>
+ * (with the effect that a subsequent call to getContentType() will
+ * include a charset=ISO-8859-1 component which will also be
+ * reflected in the Content-Type response header, thereby satisfying
+ * the Servlet spec requirement that containers must communicate the
+ * character encoding used for the servlet response's writer to the
+ * client).
+ */
+ setCharacterEncoding(getCharacterEncoding());
+ }
usingWriter = true;
outputBuffer.checkConverter();
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org