I've a GET request that sends a date in YYYY-MM-DD format to a Spring Controller. The controller code is as follows:
@RequestMapping(value="/fetch" , method=RequestMethod.GET)
public @ResponseBody String fetchResult(@RequestParam("from") Date fromDate) {
//Content goes here
}
The request is sent correctly as I'm checking with Firebug. I get the error:
HTTP Status 400: The request sent by the client was syntactically incorrect.
How can I make the controller accept this format of Date? Please help. What am I doing wrong?