1

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

joe
  • 28
  • 6
membersound
  • 81,582
  • 193
  • 585
  • 1,120
  • 2
    Using the class ... (drum roll) ResourceBundle? (http://docs.oracle.com/javase/6/docs/api/java/util/ResourceBundle.html) – JB Nizet Feb 26 '12 at 13:26

1 Answers1

3

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")

AlexR
  • 114,158
  • 16
  • 130
  • 208