tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From patri...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util CharsetMapper.java
Date Fri, 09 Aug 2002 16:22:37 GMT
patrickl    2002/08/09 09:22:36

  Modified:    catalina/src/share/org/apache/catalina Context.java
               catalina/src/share/org/apache/catalina/core
                        StandardContext.java
               catalina/src/share/org/apache/catalina/startup
                        WebRuleSet.java
               catalina/src/share/org/apache/catalina/util
                        CharsetMapper.java
  Log:
  In the Servlet 2.4 spec section 5.4 on i18n, the deployment descriptor gets new stuff for
mapping locale to character encoding.
  Submitted by:  Bob Herrmann (bob@jadn.com)
  
  Revision  Changes    Path
  1.3       +13 -4     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Context.java
  
  Index: Context.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Context.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Context.java	2 Aug 2002 01:37:42 -0000	1.2
  +++ Context.java	9 Aug 2002 16:22:36 -0000	1.3
  @@ -481,6 +481,15 @@
   
   
       /**
  +     * Add a Locale Encoding Mapping (see Sec 5.4 of Servlet spec 2.4)
  +     *
  +     * @param locale locale to map an encoding for
  +     * @param encoding encoding to be used for a give locale
  +     */
  +    public void addLocaleEncodingMappingParameter(String locale, String encoding);
  +
  +
  +    /**
        * Add a local EJB resource reference for this web application.
        *
        * @param ejb New local EJB resource reference
  
  
  
  1.4       +15 -4     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardContext.java	9 Aug 2002 02:07:12 -0000	1.3
  +++ StandardContext.java	9 Aug 2002 16:22:36 -0000	1.4
  @@ -1512,6 +1512,17 @@
   
   
       /**
  +     * Add a Locale Encoding Mapping (see Sec 5.4 of Servlet spec 2.4)
  +     *
  +     * @param locale locale to map an encoding for
  +     * @param encoding encoding to be used for a give locale
  +     */
  +    public void addLocaleEncodingMappingParameter(String locale, String encoding){
  +        getCharsetMapper().addCharsetMappingFromDeploymentDescriptor(locale, encoding);
  +    }
  +
  +
  +    /**
        * Add a local EJB resource reference for this web application.
        *
        * @param ejb New EJB resource reference
  
  
  
  1.4       +9 -4      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/WebRuleSet.java
  
  Index: WebRuleSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/WebRuleSet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WebRuleSet.java	8 Aug 2002 18:33:19 -0000	1.3
  +++ WebRuleSet.java	9 Aug 2002 16:22:36 -0000	1.4
  @@ -385,6 +385,11 @@
           digester.addCallMethod(prefix + "web-app/welcome-file-list/welcome-file",
                                  "addWelcomeFile", 0);
   
  +        digester.addCallMethod(prefix + "web-app/locale-encoding-mapping-list/locale-encoding-mapping",
  +                              "addLocaleEncodingMappingParameter", 2);
  +        digester.addCallParam(prefix + "web-app/locale-encoding-mapping-list/locale-encoding-mapping/locale",
0);
  +        digester.addCallParam(prefix + "web-app/locale-encoding-mapping-list/locale-encoding-mapping/encoding",
1);
  +
       }
   
   
  
  
  
  1.2       +14 -1     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/CharsetMapper.java
  
  Index: CharsetMapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/CharsetMapper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CharsetMapper.java	18 Jul 2002 16:47:45 -0000	1.1
  +++ CharsetMapper.java	9 Aug 2002 16:22:36 -0000	1.2
  @@ -171,5 +171,18 @@
   
       }
   
  +    /**
  +     * The deployment descriptor can have a
  +     * locale-encoding-mapping-list element which describes the
  +     * webapp's desired mapping from locale to charset.  This method
  +     * gets called when processing the web.xml file for a context
  +     *
  +     * @param locale The locale for a character set
  +     * @param charset The charset to be associated with the locale
  +     */
  +    public void addCharsetMappingFromDeploymentDescriptor(String locale,String charset)
{
  +        map.put( locale, charset );
  +    }
  +
   
   }
  
  
  

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


Mime
View raw message