Multiple Resource Bundles in JSF
All,
How can I have multiple resource bundles in JSF application.
let's say, I want to have all the login screen messages in 'login-messages.properties' file and all the order entry messages in 'order-messages.properties' file.
For a single message properties, this is how we declare in faces-config.
<application>
<message-bundle>messages</message-bundle>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
</application>
I'm pulling the resource bundle in the bean object in the following way:
Application application = FacesContext.getCurrentInstance().getApplication();
String bundleName = application.getMessageBundle();
Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale);
String value = rb.getString("invalid.user");
I would like to have module specific properties file and pull the messages accordingly. Any help with this is greatly appreciated.
Thanks,
Sridhar.

