When I try to view errors in my jsp page individually (by property), it just
repeats the entire error array as if I called the html:error without a
property attribute.  My code is below.


form.Validate()
------------------
public ActionErrors validate(ActionMapping mapping,
                                 HttpServletRequest request) {
                                                                 
                ActionErrors errors = new ActionErrors();
                
                String loginID = getLoginID();
                String password = getPassword();
                
                if(null == loginID || "".equals(loginID)){
                        errors.add("loginID", new
ActionError("error.loginID"));
                }
                
                if(null == password || "".equals(password)){
                        errors.add("password", new
ActionError("error.password"));
                }
                
                return errors;

    }
------------------


JSP:
------------------
<html:form action="LoginForm.do">

      <html:errors property="loginID" />
      <br>
      <html:text property="loginID" maxlength="40" />
      <p>

      <html:errors property="password" />
      <br>
      <html:password property="password" />

</html:form>
------------------


Result HTML:
------------------
Validation Error
You must correct the following error(s) before proceeding: 
*       Password is required 
*       Username is required 
<input type="text" name="loginID" maxlength="40" value="">

Validation Error
You must correct the following error(s) before proceeding: 
*       Password is required 
*       Username is required 

<input type="text" name="password" maxlength="40" value="">
------------------

So it's repeating the entire error array for each html:error tag, and
ignoring the property attribute.

Any ideas?

Thanks,
Jeremy

Reply via email to