请参阅何时尝试加载Validator
进行验证,如果WEB-INF / lib中缺少Validator Api,它将抛出ClassNotFoundException
,但是@Valid
不会抛出这样的错误功能,为什么呢?
///如果WEB-INF / lib中缺少Validator Api(但在构建路径中可用)
1)Validator validator = Validation.buildDefaultValidatorFactory().getValidator(); //ClassNotFoundException error
2)public ModelAndView signupValidate(@Valid @ModelAttribute("ma_Student") StudentTO Student{...} //neither work nor error