[jboss-user] [JBoss Seam] - Load Resource Bundle

jbossja do-not-reply at jboss.com
Wed Apr 4 09:14:05 EDT 2007


I'm trying to load a Resource Bundle for a particular Locale. 

In faces-config.xml I have:

  |     <message-bundle>messages</message-bundle>
  |        <locale-config>
  |             <default-locale>fr</default-locale>
  |             <supported-locale>fr</supported-locale>
  |         </locale-config>

And in my Bean I load the current Locale in this way:
  |       LocaleSelector localeSelector = LocaleSelector.instance();
  |       Locale locale = localeSelector.getLocale();
  |       ResourceBundle bundle = ResourceBundle.getBundle("messages", locale);

I have been able to get the Locale to "fr", but I can't load the Resource Bundle. I get a java.util.MissingResourceException: Can't find bundle for base name messages, locale fr.

Are there any other configurations that need to be set?

I have also tried to inject the Resource Bundle using 

  | @In java.util.ResourceBundle resourceBundle;
  | resourceBundle.getBundle("messages").getString(key);

but to no avail

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034543#4034543

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034543

More information about the jboss-user mailing list