tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Herrmann <...@jadn.com>
Subject [5] I18N, CharsetMapper, DeploymentDescriptor
Date Tue, 06 Aug 2002 16:17:03 GMT

In the Servlet 2.4 spec section 5.4 on i18n, the deployment descriptor
gets new stuff for mapping locale to character encoding. The spec says,

[Section 5.4]

"[...] The setLocale method also sets charset component in Content-Type
with an encoding information which can be obtained from the
locale-encoding-mapping element in the deployment descriptor, if
present. For example, to map a locale to the specific encoding, the
syntax of locale-encoding-mapping would be:

   <locale-encoding-mapping-list>
        <locale-encoding-mapping>
             <locale>ja</locale>
             <encoding>ISO-2022-JP</encoding>
        </locale-encoding-mapping>
    </locale-encoding-mapping-list>
" 

To implement this, I started like this, 

1. I added some lines to the digester to push the local and encoding
info into the Context 

2. I changed the context to push the mapping into the CharsetMapper
class 

3. Changed the CharsetMapper class so it can accept new mappings 

4. changed setLocale() so it consults CharsetMapper and sets the mapped
encoding


The problem with this approach is that CharsetMapper has a lot of
default values, and the spec says setting the encoding should by
consulting the Deployment Descriptor.  So I should probably create a
seperate map for the "DeploymentDescriptorLocaleEncodingMapping" in the
Context, right? ideas?

Cheers,
-bob




--
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