Bean Validation for @Past or today?
Here's a simple source, stating that this date must be in the past using Bean开发者_StackOverflow中文版 Validation :
@Past
private Date transactionDate;
Is there any BV annotation for validating that the date must be today or previous day?
Or perhaps I need to extend the constraint and provide my own?
Just found out the answer for this, @Past means today or any day before today.
So, using @Past suits my need without having to provide my own constraint.
To get past and today you can use
@PastOrPresent
精彩评论