package liulixin.org;
import com.opensymphony.xwork2.ActionSupport;
public class ErrorInfo extends ActionSupport{
public String CuoWu(){
addFieldError("SingleShowNoExist",getText("存在的就是合理的"));
return "CuoWu";
}
}
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="default" extends="struts-default">
<action name="LaiLa" class="liulixin.org.ErrorInfo" method="CuoWu">
<result name="CuoWu">/pages/error.jsp</result>
</action>
</package>
</struts>
<%@ page language="java" contentType="text/html; charset=GBK"%>
<%@ taglib uri="/struts-tags" prefix="s2"%>
<html>
<head><title>友情提示</title></head>
<body>
<center>
<table border="0" width="650" height="200" cellspacing="0" style="margin-top:20" bgcolor="#F9F9F9">
<tr>
<td align="center" style="border:1 solid">
<table><tr><td><s2:fielderror/></td></tr></table>
</td>
</tr>
</table>
</center>
</body>
</html>
源代码:http://pan.baidu.com/share/link?shareid=444691&uk=3878681452