You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "CONNER, BRENDAN (SBCSI)" <bc...@sbc.com> on 2005/07/18 18:34:20 UTC
RE: Can't find bundle
I believe your <message-bundle> entry needs to be a fully qualified base
name such as:
<messaage-bundle>com.mycompany.jsf.messages</message-bundle>
- Brendan
-----Original Message-----
From: Gur Eitan [mailto:gur@axismobile.com]
Sent: Monday, July 18, 2005 12:02 PM
To: MyFaces Discussion
Subject: Can't find bundle
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?