读取资源文件的方法
2006-04-25 16:48
323 查看
读取资源文件的方法
方法一:
jsp中:<bean:message key="lable.username"/>
方法二:
MessageResources.getMessageResources("com.yourcompany.struts.ApplicationResources");
MESSAGE.getMessage(Locale.CHINESE,"error.username");
注:
getMessageResources()参数为在struts-config.xml中定义的<message-resources parameter="profile.resources.ApplicationResources"/>中的parameter信息。
方法三:
public static final ResourceBundle eBundle =
ResourceBundle.getBundle("config", Locale.SIMPLIFIED_CHINESE);//com.perlong为包名,config为资源文件名
String strMsg = eBundle.getString(strKey);
谢谢大家^o^
方法一:
jsp中:<bean:message key="lable.username"/>
方法二:
MessageResources.getMessageResources("com.yourcompany.struts.ApplicationResources");
MESSAGE.getMessage(Locale.CHINESE,"error.username");
注:
getMessageResources()参数为在struts-config.xml中定义的<message-resources parameter="profile.resources.ApplicationResources"/>中的parameter信息。
方法三:
public static final ResourceBundle eBundle =
ResourceBundle.getBundle("config", Locale.SIMPLIFIED_CHINESE);//com.perlong为包名,config为资源文件名
String strMsg = eBundle.getString(strKey);
谢谢大家^o^
相关文章推荐
- C#读取资源文件的两种方法
- 读取资源文件的三种方法
- Android 读取工程内资源文件的两种方法
- 一个读取扩展名为xml的资源文件的方法
- Properties读取资源文件的四种方法
- 读取资源文件的N种方法- -
- spring 读取资源文件方法
- JAVA读取资源文件的N种方法
- android从资源文件中读取文件流并显示的方法
- 安卓资源文件读取方法
- 读取资源文件的N种方法- -
- 读取spring配置文件的方法(spring读取资源文件)
- Spring MVC中,通过Java代码读取资源文件时,发生乱码的解决方法
- 读取web.xml中各种类型参数的方法(读取资源文件)
- C#读取资源文件的两种方法
- java读取资源文件的N种方法
- 读取spring配置文件的方法(spring读取资源文件)
- 资源文件读取的一种方法
- ServletContext笔记和servlet和传统方法读取资源文件
- C# 读取.resx资源文件内字符串的方法