Validator and bind tag - newbie
I have a problem using validator and bind tag. My code looks like seen below. Problem is that all fields except company field get "," (comma) as return value. Only error that is shown is for company field, which validated as last field in my validate method. Any pointers appreciated.
Code:
<spring:bind path="client.name">
<input type="text" name="name" value="${status.value}"/>
<span class="fieldError">${status.errorMessage}</span>
</spring:bind>
<spring:bind path="client.company">
<input type="text" name="name" value="${status.value}"/>
<span class="fieldError">${status.errorMessage}</span>
</spring:bind>
Code:
public void validate(Object obj, Errors errors)
{
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "NAME_REQUIRED", "Name required.");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "email", "EMAIL_REQUIRED", "Email required.");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "type", "TYPE_REQUIRED", "Type required.");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "PASSWORD_REQUIRED", "Password required.");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "company", "COMPANY_REQUIRED", "Company required.");
}