1. 准备properties文件

globalMessages_en_US.properties

struts2 I18N  国际化

 globalMessages_zh_CN.properties

struts2 I18N  国际化

 

2. 配置struts.xml

<struts>
    <constant name="struts.custom.i18n.resources" value="globalMessages"/>
</struts>

3.前段页面使用字段

<%@ taglib prefix="s" uri="/struts-tags"%>
<tr>
      <td><s:text name="inputusername"/>
      <td><s:textfield name="name"/></td>
</tr>
<tr>
      <td><s:text name="inputpsw"/></td>
      <td><s:password name="password"/></td>
</tr>

 

相关文章:

  • 2022-12-23
  • 2021-12-22
  • 2021-08-16
  • 2021-08-31
  • 2021-07-14
猜你喜欢
  • 2021-10-07
  • 2021-10-16
  • 2021-12-01
  • 2021-10-29
  • 2021-09-04
相关资源
相似解决方案