java.lang.ClassCastException: org.apache.struts.action.ActionMessage 错误
java.lang.ClassCastException: org.apache.struts.action.ActionMessage
org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:215)
org.apache.jsp.login_jsp._jspx_meth_html_005ferrors_005f0(login_jsp.java:173)
org.apache.jsp.login_jsp._jspx_meth_html_005fform_005f0(login_jsp.java:115)
org.apache.jsp.login_jsp._jspService(login_jsp.java:77)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1012)
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:980)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
将
ActionErrors error=new ActionErrors();
if ("login".equals(status)) {
if (this.id == null || "".equals(this.id)) {
error.add("id", new ActionMessage("id.null"));
}
}
该为
ActionErrors error=new ActionErrors();
if ("login".equals(status)) {
if (this.id == null || "".equals(this.id)) {
error.add("id", new ActionError("id.null"));
}
}
就可以了 ActionError比ActionMessage好用