从db获取的messages.properties [英] messages.properties taken from db
本文介绍了从db获取的messages.properties的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在研究JSF应用程序的i18n。
我需要通常位于messages.properties中的所有标准jsf消息从数据库中获取。有没有一些简单的方法呢?
I'm working on i18n of JSF application. I need all standard jsf messages that are usually located in messages.properties to be taken from database. Is there some simple way to do it?
谢谢。
推荐答案
我想我找到了答案:
public class DBMessagesBundle extends ResourceBundle {
@Override
protected String handleGetObject(String key){
...
}
@Override
public Enumeration<String> getKeys() {
...
}
}
在FacesConfig.xml中
and in FacesConfig.xml
<application>
...
<message-bundle>mypackage.DBMessagesBundle</message-bundle>
</application>
感谢您的帮助。
这篇关于从db获取的messages.properties的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文