remm        02/02/20 10:40:17

  Modified:    catalina/src/share/org/apache/catalina/connector Tag:
                        tomcat_40_branch ResponseBase.java
  Log:
  - Port fix the fix for 6569.
  - Now, setLocale can be called before setContentType, and either way the charset
    will be set appropriately.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.16.2.4  +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.16.2.3
  retrieving revision 1.16.2.4
  diff -u -r1.16.2.3 -r1.16.2.4
  --- ResponseBase.java 20 Feb 2002 08:29:09 -0000      1.16.2.3
  +++ ResponseBase.java 20 Feb 2002 18:40:16 -0000      1.16.2.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseBase.java,v
 1.16.2.3 2002/02/20 08:29:09 remm Exp $
  - * $Revision: 1.16.2.3 $
  - * $Date: 2002/02/20 08:29:09 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/ResponseBase.java,v
 1.16.2.4 2002/02/20 18:40:16 remm Exp $
  + * $Revision: 1.16.2.4 $
  + * $Date: 2002/02/20 18:40:16 $
    *
    * ====================================================================
    *
  @@ -89,7 +89,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.16.2.3 $ $Date: 2002/02/20 08:29:09 $
  + * @version $Revision: 1.16.2.4 $ $Date: 2002/02/20 18:40:16 $
    */
   
   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]>

Reply via email to