Spring REST : How to validate Date passed in request body
<p>I am working on a Spring REST application.
<br>
In that I have a REST Controller like this</p>

<pre><code>@RequestMapping(value = "/patient", method = RequestMethod.POST)
        public BloodPressureDTO store(@RequestBody BloodPressureDTO bloodPressureDto) {

      .........
}
</code></pre>

<p>The <code>BloodPressureDTO</code> object has a <code>Date</code> object inside it.
<br>
I need to validate the <code>Date</code> object.</p>

<p>If the JSON that is posted in the request has an invalid date format, then I would like to handle that situation.</p>