Adding javax.validation capabilities to Tomcat

蓝咒 提交于 2019-12-12 12:25:57

问题


I'm trying to run a web application using Tomcat but the the application is using libraries such as:

import javax.validation.constraints.Future;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

These libraries are not part of the Tomcat spec so I need to add them manually.

What libraries should I add?


回答1:


The javax.validation package is a Bean Validation (JSR-303) library.

An implementation of this specification is i.e. the Hibernate Validator or the Apache Bean Validation.




回答2:


but for Size and NotNull you need http://www.java2s.com/Code/Jar/b/Downloadbeanvalidatorjar.htm



来源:https://stackoverflow.com/questions/8605753/adding-javax-validation-capabilities-to-tomcat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!