tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Locale difference with Console and Windows Service
Date Sat, 04 Nov 2006 13:55:47 GMT
Hash: SHA1


> I am using Windows XP, Tomcat 5.5.17, JRE 1.5.0_08. I am in Australia. To
> test localization, my Windows Region is set to English, US. 

Is the locale of your /user/ set to en_US, or is the whole OS set to that?

> When using the Console, tomcat5.exe, my localization files work correctly,
> returning the Locale, en_US. 
> When using Windows Services, the Locale returned is en.AU with the same code
> and Region still set to English, US. 

Since windows services run as another user (I'm sure you can pick), you
need to make sure that the locale of /that/ user is set appropriately.
Is it possible that the user that services "run as" is not configured
for en_US?

> Any help explaining how to get the default Locale using Services would be
> appreciated. I do not want to set the Locale, but to get and apply my users
> default Locale using Services. 

In our apps, we sniff the locale of the user from the request and stick
it in the session (actually, Struts does that for us). You can then use
that locale for resource bundles, time and date formatting, etc. Any
reason to worry about the "default" locale in your case?

> The same problem applies to the use of the Robot class used for sending
> keystrokes. OK with Console, no response or error with Services. 

Well, that's a different problem. Do services have a console to run in?
I would imagine that the service gets run in a manner quite like a UNIX
app with no X availability. If that's true, then there's nothing to
which you can send keystrokes.

- -chris

Version: GnuPG v1.4.5 (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