Struts2 资源配置文件国际化详解
来源:互联网 发布:python bytes 编辑:程序博客网 时间:2024/06/05 04:18
Struts2 资源配置文件国际化
Struts2资源文件的命名规范:basename_language_country.properties
Struts2国际化
如果系统同时存在资源文件、类文件,系统将以类文件为主,而不会调用资源文件。
对于简体中文的Locale,ResourceBundle搜索资源的顺序是:
(1)baseName_zh_CN.class
(2)baseName_zh_CN.properties
(3)baseName_zh.class
(4)baseName_zh.properties
(5)baseName.class
(6)baseName.properties
Struts2资源文件加载方式有3种,
1.全局资源配置文件
2.包资源配置文件
3.Action资源配置文件
查找顺序:Action资源配置文件>包资源配置文件>全局资源配置文件
1.全局资源文件加载方式:
struts.xml
<constant name="struts.custom.i18n.resources" value="baseName"/>
或
struts.properties
struts.custom.i18n.resources=baseName
2.包资源文件加载方式:
文件命名规范:package_language_country.properties
将包资源文件放到 Action所在的包目录中
3.Action资源配置文件加载方式:
文件命名规范:Action_language_country.properties
将Action资源配置文件 放到Action所在的包目录中
struts2标签使用资源配置文件
key:资源文件中的key path:资源文件所在的路径
<s:i18n name="path">
<s:text name="key">
<s:param>参数</s:param>
</s:text>
</s:i18n>
原文:http://hi.baidu.com/xzl_awin/item/4053a61d92101efe9c778afe
相关文章:http://www.cnblogs.com/cookray/archive/2012/10/15/2724195.html
- Struts2 资源配置文件国际化详解
- Struts2 资源配置文件国际化
- Struts2 资源配置文件国际化
- 学习国际化资源配置1.
- struts2国际化详解
- struts2国际化详解
- struts2国际化详解
- struts2之国际化详解
- Struts2国际化详解 i18n
- struts2 资源文件:国际化
- struts2国际化文件配置
- struts2引用国际化资源文件
- struts2 国际化资源文件测试
- Struts2定义国际化资源文件
- django 静态资源配置详解
- log4j.properties资源配置文件
- java中的资源配置文件
- servlet读取资源配置文件
- PHP大量用户登录解决方案
- LeetCode之求二叉树最大路径和
- Python 小甲鱼教程 乌龟吃鱼游戏
- office下载、安装和激活(包含Visio)
- hadoop 开发调试环境
- Struts2 资源配置文件国际化详解
- tortoisegit 还原到某个版本
- 信号互相关及其应用
- AJAX 解析获取的返回json
- LeetCode—375. Guess Number Higher or Lower II
- 关于scrollview的滚动
- Android6.0权限处理
- More Effective C++读书小记
- 【spring 7】spring和Hibernate的整合:声明式事务