I am confused about servlets vs. jsps working with locales. I developed an app on a linux machine with environment variable LANG set to de_DE.utf8. I used NumberFormat.getInstance() and nf.parse() from a servlet and <fmt:formatNumber type="currency"> in a jsp, like this:
That worked well, until I deployed the app on another machine which had (which I didn't know earlier) LANG set to en_US.utf-8. Now, I can fix it by using NumberFormat.getInstance(LOCALE.GERMANY) - but what really puzzles me is why the jsp part - fmt:FormatNumber - worked allright all the same! That is, when I first called my app with a certain value, it was formatted correctly (as if I'd configured the right locale)! Only the other way round, it didn't work - that is, nf.parse() did NOT use the German locale...
Can anybody give me a hint what's the matter here? Thanks in advance, Sigrid
Joined: Jan 14, 2007
I think I had better posted this on another forum... As I suppose it's forbidden to post the same thing twice, but I really am puzzled by this thing, I'd like to ask you to move this to a better suiting place (SCJP?)