I am moving our JSF messages.properties outside the war so QA and ops people can modify messages without generating a new war.
I've created a JBoss 7 module and placed the messages.properties file in $JBOSS_HOME/modules/com/acme/revenue/main/messages.properties. I updated jboss-deployment-structure.xml to include
<module name="com.acme.revenue"/>
And I put a module.xml file in $JBOSS_HOME/modules/com/acme/revenue/main. It contains:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.acme.revenue">
<resources>
<resource-root path="."/>
</resources>
</module>
This all works. In the java code I can call:
ResourceBundle bundle = ResourceBundle.getBundle("messages", Locale.getDefault());
bundle.getString("TargetingKey")
and it returns the translated value "Income Targeting". However in the JSF .xhtml files code calls #{messages.TargetingKey} and it is not working because JSF doesn't seem to find the resource bundle.
Before the change the faces-config.xml contained the following and it worked fine:
<resource-bundle>
<base-name>com.acme.revenue.messages</base-name>
<var>messages</var>
</resource-bundle>
How can I fix this JSF declaration to find the bundle, and display the messages?
Thank you.