aspose file tools*
The moose likes JSP and the fly likes <fmt:bundle> defaults to english (in firefox)? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "<fmt:bundle> defaults to english (in firefox)?" Watch "<fmt:bundle> defaults to english (in firefox)?" New topic
Author

<fmt:bundle> defaults to english (in firefox)?

D. Ogranos
Ranch Hand

Joined: Feb 02, 2009
Posts: 214
In my test project, I have two resource bundles: messages.properties (german) and messages_en.properties. The german version is intended to be the default.

I can access them in my controller like this:


Both when called from IE and from Firefox, this results in the same message (german). The request Locale is the same ("de_DE" when printed as request.getLocale().toString()), but I suppose that doesn't matter here since getBundle(name) uses the default (server) locale, right?

Then, in my JSP then I use the following:


When called from IE, this displays the german message, but when called from Firefox, this displays the english message. The request locale is the same for both browsers ("de_DE"). Why does the <fmt:bundle> tag get the wrong message bundle?

If I explicitely set the locale in the JSP with


then I get the correct message in Firefox too, but I don't understand why I need to do this (and if its the correct thing to do). I would have thought that the <fmt:bundle> tag uses something like getResourceBundle(name, locale) with the request locale, but apparently that's not what happens..
 
 
subject: <fmt:bundle> defaults to english (in firefox)?
 
Similar Threads
locales and jsf
Is there a way to use "prefix" with <fmt:setBundle> in JSTL format tags?
Using resource bundle as input for a custom tag
Display ActionMessage in JSP using fmt:message
Override request headers