1. Basic validate on bean‘s attribute.
@Notnull
@Max
@Min
@Pattern
...
2. Validate by logic
1) password repeat if same (server validate/client validate)
@InitBinder("form") public void initBinder(WebDataBinder binder) { binder.addValidators(userCreateFormValidator); }
public class UserCreateFormValidator implements Validator {
...
}
时间: 2024-10-10 20:27:08