示例#1
0
 public void validateStep3(Object command, Errors errors) {
   FullUser fullUser = (FullUser) command;
   if (fullUser.getFavorites() == null || fullUser.getFavorites().size() == 0) {
     errors.rejectValue("favorites", "required.favorites", "至少需要选择一个爱好");
   }
 }
示例#2
0
 public void validateStep1(Object command, Errors errors) {
   FullUser fullUser = (FullUser) command;
   ValidationUtils.rejectIfEmptyOrWhitespace(errors, "userName", "required.username", "用户名必须填写");
   ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "required.password", "密码不能为空");
   validateEmail(fullUser.getEmail(), errors);
 }