Struts2中国际化

1.  写资源文件

Msg.properties   默认的语言环境; 找不到配置就找它

Msg_en_US.properties  美国

2.  加载

<constant name="struts.custom.i18n.resources" value="loaderman.config.msg"></constant>

3. 使用: 标签name值直接写配置文件中的key

<s:text name="title"></s:text>

另外一点,

         (推荐)加载资源文件通过常量加载

         还可以在页面加载, 这样用:

           

                 <s:i18n name="loaderman.config.msg">

                            <s:text>  标签必须放到标签体中。

                   </s:i18n>
    <!-- 通过常量加载资源文件 -->
    <constant name="struts.custom.i18n.resources" value="loaderman.config.msg"></constant>
原文地址:https://www.cnblogs.com/loaderman/p/10033116.html