RT

解决方案 »

  1.   

    一、以message作为名称创建message.properties,message_zh_CN.properties ,message._en_US.properties
    三个文件
    二、在struts.xml中配置 也可以在struts.properties中配置,这里就在xml里配了<constant name="struts.custom.i18n.resources" value="message"></constant>  这里的value和步骤一的名字匹配
    三、在代码中引用国际化消息this.addFieldError(Constants.ERROR_INFO,getText(CoreErrorCode.DATA_NOT_EXIST+""));
    四、前台页面的回显<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    <%@ taglib prefix="s" uri="/struts-tags"%>
    <s:fielderror></s:fielderror>