简体   繁体   English

除hibernate-validator以外的LocalValidatorFactoryBean的实现?

[英]Implementation of LocalValidatorFactoryBean other than hibernate-validator?

Do you know an implementation of springframework's LocalValidatorFactoryBean other than hibernate-validator? 您是否知道除hibernate-validator之外的springframework的LocalValidatorFactoryBean的实现?

We don't want hibernate-validator because it fetches too many dependencies in a small spring-mvc 3 application that doesn't use hibernate. 我们不希望使用hibernate-validator,因为它在不使用hibernate的小型spring-mvc 3应用程序中获取了太多的依赖关系。

I can't precisely answer you question with respect to other implementations of LocalValidatorFactoryBean , but what concerns the dependencies of Hibernate Validator, there are actually not that many. 关于LocalValidatorFactoryBean其他实现,我无法精确回答您的问题,但是与Hibernate Validator的依赖关系有关的实际上并不多。

The only strict dependency besides the JSR 303 API (validation-api-1.0.0.GA.jar) is slf4j-api-1.5.6.jar plus a binding for it (here you could use the NOP binding for instance if you don't want to pull in a logger). 除了JSR 303 API(validation-api-1.0.0.GA.jar)之外,唯一严格的依赖项是slf4j-api-1.5.6.jar及其绑定(在这里,您可以使用NOP绑定,例如,不想使用记录器)。

All the other dependencies are optional and can be left out depending on your setup/requirements (eg JAXB is only required when working with XML descriptors and running on JDK 5). 所有其他依赖项都是可选的,可以根据您的设置/要求将其忽略(例如,仅当使用XML描述符并在JDK 5上运行时才需要JAXB)。

正如Raghuram指出的那样,有一个Apache Bean验证 (以前称为agimatec)似乎比Hibernate的效率更高。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM