tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Herrmann <>
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:


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

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

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

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?


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message