tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/tester/src/bin tester.xml
Date Wed, 18 Apr 2001 20:40:32 GMT
craigmcc    01/04/18 13:40:32

  Modified:    catalina/src/share/org/apache/catalina/connector
                        HttpResponseBase.java
               tester/src/bin tester.xml
  Log:
  Enhance the return value for the "Content-Language" header to include the
  country code, if specified.  Now, if you call
  
    response.setLocale(new Locale("en", "US"));
  
  the header that is created will be:
  
    Content-Language: en-US
  
  in accordance with the requirements of Section 3.10 of the HTTP/1.1 spec.
  
  Revision  Changes    Path
  1.30      +13 -6     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java
  
  Index: HttpResponseBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- HttpResponseBase.java	2001/03/28 05:15:14	1.29
  +++ HttpResponseBase.java	2001/04/18 20:40:30	1.30
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java,v
1.29 2001/03/28 05:15:14 remm Exp $
  - * $Revision: 1.29 $
  - * $Date: 2001/03/28 05:15:14 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java,v
1.30 2001/04/18 20:40:30 craigmcc Exp $
  + * $Revision: 1.30 $
  + * $Date: 2001/04/18 20:40:30 $
    *
    * ====================================================================
    *
  @@ -99,7 +99,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.29 $ $Date: 2001/03/28 05:15:14 $
  + * @version $Revision: 1.30 $ $Date: 2001/04/18 20:40:30 $
    */
   
   public class HttpResponseBase
  @@ -778,8 +778,15 @@
   
   	super.setLocale(locale);
   	String language = locale.getLanguage();
  -	if ((language != null) && (language.length() > 0))
  -	    setHeader("Content-Language", language);
  +	if ((language != null) && (language.length() > 0)) {
  +            String country = locale.getCountry();
  +            StringBuffer value = new StringBuffer(language);
  +            if ((country != null) && (country.length() > 0)) {
  +                value.append('-');
  +                value.append(country);
  +            }
  +	    setHeader("Content-Language", value.toString());
  +        }
   
       }
   
  
  
  
  1.32      +2 -2      jakarta-tomcat-4.0/tester/src/bin/tester.xml
  
  Index: tester.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/tester/src/bin/tester.xml,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- tester.xml	2001/04/18 19:53:02	1.31
  +++ tester.xml	2001/04/18 20:40:31	1.32
  @@ -650,12 +650,12 @@
       <tester host="${host}" port="${port}" protocol="${protocol}"
            request="${context.path}/SetLocale01" debug="${debug}"
         outContent="SetLocale01 PASSED"
  -      outHeaders="Content-Language:en"/>
  +      outHeaders="Content-Language:en-US"/>
   
       <tester host="${host}" port="${port}" protocol="${protocol}"
            request="${context.path}/WrappedSetLocale01" debug="${debug}"
         outContent="SetLocale01 PASSED"
  -      outHeaders="Content-Language:en"/>
  +      outHeaders="Content-Language:en-US"/>
   
   
     </target>
  
  
  

Mime
View raw message