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: