tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteResponse.java
Date Thu, 01 May 2003 20:47:17 GMT
remm        2003/05/01 13:47:17

  Modified:    catalina/src/share/org/apache/coyote/tomcat5
                        CoyoteResponse.java
  Log:
  - Fix bug 18251: usage of setLocale.
  
  Revision  Changes    Path
  1.2       +15 -15    jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteResponse.java
  
  Index: CoyoteResponse.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteResponse.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CoyoteResponse.java	19 Apr 2003 18:49:10 -0000	1.1
  +++ CoyoteResponse.java	1 May 2003 20:47:17 -0000	1.2
  @@ -734,6 +734,9 @@
               return;
   
           coyoteResponse.setContentType(type);
  +        if ((type != null) && (type.indexOf(";charset=") != -1)) {
  +            isCharacterEncodingSet = true;
  +        }
           isContentTypeSet = true;    
       }
   
  @@ -760,7 +763,7 @@
               return;
   
           coyoteResponse.setCharacterEncoding(charset);
  -        isCharacterEncodingSet= true;
  +        isCharacterEncodingSet = true;
       }
   
       
  @@ -779,26 +782,23 @@
           // Ignore any call from an included servlet
           if (included)
               return;
  -        
  +
  +        coyoteResponse.setLocale(locale);
  +
           // Ignore any call made after the getWriter has been invoked.
           // The default should be used
           if (usingWriter)
               return;
  -        
  -        if (isCharacterEncodingSet){
  -            return;       
  -        }
  -        
  -        if (isContentTypeSet){
  -            return;       
  +
  +        if (isCharacterEncodingSet) {
  +            return;
           }
  -        
  -        coyoteResponse.setLocale(locale);
   
           CharsetMapper cm = context.getCharsetMapper();
           String charset = cm.getCharset( locale );
           if ( charset != null ){
               coyoteResponse.setCharacterEncoding(charset);
  +            isCharacterEncodingSet = true;
           }
   
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message