tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Migrating to tomcat 6 gives formatted currency amounts problem
Date Fri, 12 Sep 2008 19:52:23 GMT
Hash: SHA1


Johnny Kewl wrote:
> Servlet Response does in fact have a setLocale(Locale loc) function...
> Which seems to indicate that if headers or something like
> response.setContentType("text/html;charset=UTF-8");
> is *not* used... TC will take on the encoding(ha ha did it again)
> charset of that locale...

Nope! Locale != charset. Locale does not even hint of a /preferred/ charset.

> I find thinking outside of HTTP headers difficult... and it seems that
> servlet spec has recognized the conflict inherent in locale and http
> header.
> It seems that prior to Servlet spec 2.4 if a coder used locale dependent
> JSTL to access resource bundles... that would in fact override
> setContentType.... this apparently is no longer the case... the header
> takes pref...

Well, the header comes from the encoding set on the response, so it
should all be the same.

> I think you just got to put on a different hat when doing Swing and Web
> internationalization...

You shouldn't have to. The only difference is the character encoding for
the requests and responses. The use of the Java API should be identical.

- -chris
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message