@Valid @Validated @Validator
时间: 2023-09-30 20:13:22 浏览: 95
Spring @Valid @Validated实现验证
@Valid和@Validated是Java中用于数据验证的注解。它们的主要区别在于使用的验证机制和框架不同。@Valid注解是在使用Hibernate validation时使用的,而@Validated注解是在使用Spring Validator校验机制时使用的。而@Validated注解是Spring框架提供的,在方法参数上使用时,它会使用Spring Validator校验机制进行验证。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [@Valid与@Validated的区别](https://blog.csdn.net/jcc4261/article/details/129118411)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [Validated、Valid 、Validator,他们的区别你知道几个](https://blog.csdn.net/fly910905/article/details/119850168)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文