当前位置: 代码迷 >> Web前端 >> 国际化时配备时配置
  详细解决方案

国际化时配备时配置

热度:152   发布时间:2012-09-09 09:27:54.0
国际化时配置时配置
国际化时配置时配置struts.custom.i18n.resources常量三种方法:
假设要定义配置一个 basename为globalMessages的strut.custom.i18n.resources常量


1.在属性文件struts.properties中定义:
#在属性文件中定义basejname
struts.custom.i18n.resources=globalMessage


2.在struts.xma文件中配置basename;
I18N资源文件为globalMessage
<constant name="struts.custom.i18n.resources"   value="globalMessage" />


3.在web.xml文件中定义:
<!--定义struts.custom.i18n.resources 常量-->
<init-param>
<param-name>struts.custom.i18n.resources</param-name>
<param-value>globalMessage</param-balue>
</init-param>
......
配置好struts2框架的国际化资源文件的basename后,开发者就可以按照basename_language_country.properties命名规则来建立不同语言环境的资源文件了。(注意:一定要unicode编码)
  相关解决方案