I am trying to use type=Date
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.
My domain class:
public class Doctor{
@DateTimeFormat(pattern = "MM-DD-YYYY")
private Date dateOfBirth=null;
// Setter and Getter
}
JSP code:
<f:input path="dateOfBirth" type="Date"/>
I tried using the @InitBinder in contoller as well, but could not succeed.