开发者

Spring javax.validation problem

In my application with spring framework, I have this import which it couldn't find

 import javax.validation.Valid;

Thing is I already have that javax.jar in the classpath. So my question is is there a different version of javax.jar that has validation package or I need any other jar files? I couldn't find any javax.jar that has v开发者_如何学运维alidation package on the internet. So please give me a link if you know any. Thanks in advance!


You're looking for javax.validation:validation-api.

Also, as Amir mentioned, if you've found stackoverflow useful, accept some answers. People will be more inclined to help out.


javax.validation.* is part of jsr-303 which needs to be downloaded separately here.


If you are using maven, just add the external dependency in your pom.xml

<dependency>
    <groupId>javax.validation</groupId>
    <artifactId>validation-api</artifactId>
    <version>2.0.1.Final</version>
</dependency>

Verify the latest version here: https://mvnrepository.com/artifact/javax.validation/validation-api

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜