【发布时间】:2014-09-09 11:29:44
【问题描述】:
在基于 JSF 的项目中,我有不同的语言环境文件用于向用户发送消息。 我想使用 Key 从我的项目中可用的所有语言环境中检索消息
我在托管 bean 中使用
String message=ResourceBundle.getBundle("com.tech.resources.messages",
new Locale(loggedInUser.getLanguage())).getString("label.hostel.room.allocated");
我希望所有消息作为一个数组或列表与所有资源包中的此键相关联,而不是一个字符串,例如 messages.properties、messages_hin.properties 等。
【问题讨论】:
标签: jsf properties locale