remm        02/03/10 23:51:20

  Modified:    coyote/src/java/org/apache/coyote Response.java
  Log:
  - Both the tester and Watchdog like to get the country code added to the language.
    Returning the language only is correct according to the HTTP spec, so is it really 
required ?
  
  Revision  Changes    Path
  1.7       +11 -2     
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java
  
  Index: Response.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Response.java     8 Mar 2002 23:48:32 -0000       1.6
  +++ Response.java     11 Mar 2002 07:51:20 -0000      1.7
  @@ -403,6 +403,7 @@
        * the default encoding
        */
       public void setLocale(Locale locale) {
  +
           if (locale == null) {
               return;  // throw an exception?
           }
  @@ -412,9 +413,17 @@
   
           // Set the contentLanguage for header output
           contentLanguage = locale.getLanguage();
  +        if ((contentLanguage != null) && (contentLanguage.length() > 0)) {
  +            String country = locale.getCountry();
  +            StringBuffer value = new StringBuffer(contentLanguage);
  +            if ((country != null) && (country.length() > 0)) {
  +                value.append('-');
  +                value.append(country);
  +            }
  +            // only one header !
  +            headers.setValue("Content-Language").setString(value.toString());
  +        }
   
  -     // only one header !
  -     headers.setValue("Content-Language").setString(contentLanguage);
       }
   
       public String getCharacterEncoding() {
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to