I'm using Spring 2.5 with JSF 1.2, on Tomcat 6.0.13.
In one part of code, I'm trying to load ResourceBundle by using following approach:
ResourceBundle.getBundle(context.getApplication().getMessageBundle(), Locale.EN);
The problem is that getMessageBundle() method returns null. This used to work with JSF 1.1. Does anybody have idea what could be the problem?
For now I'm going to hardcode bundle name, but I would prefer if all my configuration data will be placed inside faces-config.
Resource bundle is set as following:
<application>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
<resource-bundle>
<base-name>org.mysite.MessageBundle</base-name>
<var>msgs</var>
</resource-bundle>
</application>
The getMessageBundle()
returns the value of <message-bundle>
entry in faces-config.xml
, not the <resource-bundle>
entry.
Its value is actually not avaliable by the JSF 1.2 API. You have to specify it yourself.
ResourceBundle bundle = context.getApplication().getResourceBundle(context, "org.mysite.MessageBundle");
The <message-bundle>
is for validation/conversion messages. Probably you've actually used this in JSF 1.1.