Author: markt
Date: Sat Mar 7 19:42:09 2009
New Revision: 751313
URL: http://svn.apache.org/viewvc?rev=751313&view=rev
Log:
Allow the AddDefaultCharsetValve to be effective when a writer is used
Modified:
tomcat/trunk/java/org/apache/catalina/connector/Response.java
Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Response.java?rev=751313&r1=751312&r2=751313&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Response.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Response.java Sat Mar 7
19:42:09 2009
@@ -811,9 +811,11 @@
if (included)
return;
- // Ignore any call made after the getWriter has been invoked
- // The default should be used
- if (usingWriter)
+ // Normally calls to this method after the getWriter has been invoked
+ // will be ignored. The exception allows the addDefaultCharsetValve to
+ // insert the default charset in appropriate circumstances
+ if (usingWriter && (isCharacterEncodingSet ||
+ !getCharacterEncoding().equalsIgnoreCase(charset)))
return;
coyoteResponse.setCharacterEncoding(charset);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]