Currently my project has three resource bundles in my faces-config.xml
as follows:
<resource-bundle>
<base-name>com.example.text.common</base-name>
<var>common</var>
</resource-bundle>
<resource-bundle>
<base-name>com.example.text.option1</base-name>
<var>option1</var>
</resource-bundle>
<resource-bundle>
<base-name>com.example.text.option2</base-name>
<var>option2</var>
</resource-bundle>
I need to use two resource bundles, the common bundle will always be used and is hard coded in the view pages of my site. However, I wish to only use one of the two option bundles, either option1
or option2
. Is there a way to specify which of the two option bundles to use based on a condition. The desired outcome is that is this case:
<h:outputText value="#{oneOfTheOptions['contact.explanation']}"/>
the oneOfTheOptions
would be dynamically set to one of the appropriate bundle name. Is there a mechanism in JSF that can accomplish this ? If not, is any other way to dynamically set the Resource Bundle for view components ?
Thanks,