Date in Spring MVC
<p>I am trying to use <code>type=Date</code> in my JSP page to parse the date to the controller. But I am getting syntactically incorrect data (400 error). I tried my best to find the solution but failed to get the proper one. Please help me to solve this. Any suggestions would be appreciated.</p>

<p>My domain class:</p>

<pre><code>public class Doctor{  
     @DateTimeFormat(pattern = "MM-DD-YYYY")
     private Date dateOfBirth=null;

     // Setter and Getter
}
</code></pre>

<p>JSP code:</p>

<pre><code>&lt;f:input path="dateOfBirth" type="Date"/&gt;
</code></pre>

<p>I tried using the @InitBinder in contoller as well, but could not succeed.</p>