CircleSmart的个人博客

一步一个脚印

博客园 首页 新随笔 联系 订阅 管理

1.在struts.xml中配置

<constant name="struts.custom.i18n.resources" value="resourceFileName"></constant>
<constant name="struts.i18n.encoding" value="utf-8"></constant>

2.在src文件下添加国际化资源文件

例:xxResource_zh_CN.properties   login.username="用户名"

  xxResource_en_US.properties   login.username="username"

3.访问方式

<s:text name="" key="login.username" />

 <s:textfield name="" label="%{getText('login.username')}" />

4.<a href="lang?request_locale=en_US" />

5.创建Action,只需返回SUCCESS,跳转到原网址即可

posted on 2017-04-16 11:09  circlesmart  阅读(77)  评论(0编辑  收藏  举报