标签:validate return ltm result spring error erro message dap
Validator validator = new SpringValidatorAdapter(Validation.buildDefaultValidatorFactory().getValidator());
BindingResult bindingResult = new BindException(appCustomerVo, "appCustomerVo");
validator.validate(appCustomerVo,bindingResult);
if (bindingResult.hasErrors()) {
return new ApiResult().error(Constant.RETURN_CODE_00001, bindingResult.getAllErrors().get(0).getDefaultMessage());
}
validator 手动验证 表单字段 不基于注解@Valid
标签:validate return ltm result spring error erro message dap
原文地址:http://www.cnblogs.com/wangdaijun/p/6782698.html