开发者

Is there a way using javax.validation to validate that a date is larger / less than or between specific dates?

开发者 https://www.devze.com 2023-02-17 15:41 出处:网络
I know of @Future and @Past开发者_运维百科 but they compare to the local VM system date. What am I missing?I don\'t think there is an annotation in javax.validation that does what you want, but you ca

I know of @Future and @Past开发者_运维百科 but they compare to the local VM system date. What am I missing?


I don't think there is an annotation in javax.validation that does what you want, but you can always create your own validator by extending the ConstraintValidator interface. You can see an example here: http://docs.jboss.org/hibernate/validator/4.0.1/reference/en/html/validator-customconstraints.html

0

精彩评论

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