Hi
I know this is basically a myfaces discussion group, but as I know
there're many specialists here, I would be most grateful if anyone could
help with my general JSF problem:
I'm trying to use message bundles but have a problem.
I have the following defined in faces-config.xml
<application>
   <message-bundle>messages</message-bundle>
   <locale-config>
       <default-locale>en</default-locale>
       <supported-locale>es</supported-locale>
   </locale-config>
</application>

I also have in my classpath 2 files:
messages_en.properties and messages_es.properties.

When I try to do the following from the java code:
FacesContext context = FacesContext.getCurrentInstance();
UIViewRoot root = context.getViewRoot();
Application app = context.getApplication();
ResourceBundle bundle =
ResourceBundle.getBundle(app.getMessageBundle(), root.getLocale());

I get the following exception:
java.util.MissingResourceException:
Can't find bundle for base name messages, locale en

What am I doing wrong?

Reply via email to