I'd like to retrieve a resource bundle string based on locale for a specific backing bean class.
In *.jsf
files I'd just use #{text['my.string']}
. How do I do this in my backing bean class?
ty
I'd like to retrieve a resource bundle string based on locale for a specific backing bean class.
In *.jsf
files I'd just use #{text['my.string']}
. How do I do this in my backing bean class?
ty
ResourceBundle.getBundle("bundleName").getString("my.string")
Pay attention: bundleName is the name of properties file without the extension "properties". For example if you have file messages.properties
you should call ResourceBundle.getBundle("messages")