remm 02/02/20 10:33:26
Modified: catalina/src/share/org/apache/catalina/connector
ResponseBase.java
Log:
- Fix the fix for 6569.
- Now, setLocale can be called before setContentType, and either way the charset
will be set appropriately.
Revision Changes Path
1.22 +8 -5
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseBase.java
Index: ResponseBase.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseBase.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ResponseBase.java 20 Feb 2002 08:29:00 -0000 1.21
+++ ResponseBase.java 20 Feb 2002 18:33:26 -0000 1.22
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseBase.java,v
1.21 2002/02/20 08:29:00 remm Exp $
- * $Revision: 1.21 $
- * $Date: 2002/02/20 08:29:00 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseBase.java,v
1.22 2002/02/20 18:33:26 remm Exp $
+ * $Revision: 1.22 $
+ * $Date: 2002/02/20 18:33:26 $
*
* ====================================================================
*
@@ -89,7 +89,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
- * @version $Revision: 1.21 $ $Date: 2002/02/20 08:29:00 $
+ * @version $Revision: 1.22 $ $Date: 2002/02/20 18:33:26 $
*/
public abstract class ResponseBase
@@ -868,6 +868,9 @@
encoding = RequestUtil.parseCharacterEncoding(type);
if (encoding == null)
encoding = "ISO-8859-1";
+ } else {
+ if (encoding != null)
+ this.contentType = type + ";charset=" + encoding;
}
}
@@ -891,7 +894,7 @@
if ((this.encoding == null) && (this.context != null)) {
CharsetMapper mapper = context.getCharsetMapper();
this.encoding = mapper.getCharset(locale);
- if (contentType.indexOf(';') < 0) {
+ if ((contentType != null) && (contentType.indexOf(';') < 0)) {
contentType = contentType + ";charset=" + encoding;
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>