I have following bean:
class CampaignBeanDto {
@Future
Date startDate;
Date endDate;
...
}
Obviously I that endDate
should be after startDate. I want to validate it.
I know that I can manually realize annotation for @FutureAfterDate
, validator for this and initialize threshold date manually but I want to use @Validated
spring mvc annotation.
How can I achieve it?
You're gonna have to bear down and write yourself a Validator.
This should get you started:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.