I have a JSP file,and I use <html:errors> in this page,but it raise error,my
code is follows:

<%@ taglib uri="/WEB-INF/struts-form.tld" prefix="html" %>
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<html:errors/>
<html:form method="post" action="log.do">
<html:text property="abc" /><html:errors property="abc"/>
</html:form>

and my Form is follows:
......
public ActionErrors validate(ActionMapping mapping,HttpServletRequest
request) {
ActionErrors errors = new ActionErrors();
if(abc!=null && abc.length()>0){
   errors.add("abc",new ActionError("error.abc.required"));
 }
 return errors;
}

When I run it,it raise following error:
org.apache.jasper.JasperException: /index.jsp(8,15) Attribute property
invalid for tag errors according to TLD
org.apache.jasper.servlet.JspServletWrapper.handleJspException(
JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java
:2149)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1565)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I have looked up <html:errors> API,I find it have property attribute:
  property Name of the property for which error messages should be
displayed. If not specified, all error messages (regardless of property) are
displayed. (RT EXPR)

Why raise above error? How to do with it?

Thanks in advance!

Reply via email to