I have the following call
$.getJSON("/svrBooking/json/getEmployeesByManager",{
manager: "Paul Walker",
endDate: endDate, --> "Thu May 28 16:52:25 BST 2015"
startDate: startDate, --> "Thu Apr 30 16:52:25 BST 2015"
ajax: 'true'
}, function (result) {...});
This is calling the following Java code
@RequestMapping(value="/getEmployeesByManager" , method = RequestMethod.GET)
public @ResponseBody ReservationsCount
getEmployeesByManager(Model model,@RequestParam String manager,@RequestParam Date startDate, @RequestParam Date endDate) throws ParseException{...}
I am getting the following error
GET 'http://localhost:8080/svrBooking/json/getEmployeesByManager?manager=Paul+Walker&endDate=Thu+May+28+16%3A52%3A25+BST+2015&startDate=Thu+Apr+30+16%3A52%3A25+BST+2015&ajax=true' 400 bad request
the response says
The request sent by the client was syntactically incorrect.
This only started happening when i passed in the Date objects to the getJSON call. If i change the dates to strings everything works fine. Does anyone know what is going on here?