struts2 的国际化

一、使用步骤

1)写资源文件,资源文件名命名规范和之前的讲的一致,有疑问请参考java开发中国际化

2)配置,在 struts.xml 中使用常量进行加载

struts.custom.i18n.resources=properties文件的基础名+包名,例如<constant name="struts.custom.i18n.resources" value="com.baidu.properties.msg"></constant>

3)使用,在web 页面中引入struts标签,使用<s:text name="key"> 设置name属性为properties文件的key值。

<%@taglib uri="/struts-tags" prefix="s"%>
。。。
<title><s:text name="title"></s:text></title>
。。。
原文地址:https://www.cnblogs.com/zhaopengcheng/p/6703668.html