Spring MVC 3验证 - 无法找到默认提供程序 [英] Spring MVC 3 Validation - Unable to find a default provider

查看:129
本文介绍了Spring MVC 3验证 - 无法找到默认提供程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试设置Spring MVC验证时出错。

I get an error when trying to set up Spring MVC validation.

javax.validation.ValidationException: Unable to find a default provider

我在文件中读到他们使用的默认提供者是hibernate-validator。我是否需要包含此库才能使验证工作?即使我没有在我的项目中使用hibernate,也可以包含这个库吗?

I read in the documents that the default provider they use is the hibernate-validator. Do I need to include this library to get validation to work? Is it okay to include this library even though i'm not using hibernate for my project?

推荐答案

是的,你应该包含Hibernate验证器库以便使用它。它不依赖于Hibernate本身。

Yes, you should include Hibernate Validator library in order to use it. It doesn't depend on Hibernate itself.

这篇关于Spring MVC 3验证 - 无法找到默认提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆