Spring: The request sent by the client was syntactically incorrect () Spring: The request sent by the client was syntactically incorrect () spring spring

Spring: The request sent by the client was syntactically incorrect ()


In cases like this it is very useful to have org.springframework.web loggin level set to DEBUG in log4j configuration

<logger name="org.springframework.web">    <level value="DEBUG" />    ...</logger>

E.g. when parameter is missing or cannot be converted to the required type there will be an exception details in the log.


In my case the reason of this error was that browser (Chrome, in my particular case) was sending the date from the <input type="date" ... /> to the server in the wrong format so server didn't know how to parse it.


As said ike3, using the detailed log aided a lot to find the solution for me. In my case it was a mismatch between @PathVariable without name specified, and the variable itself.

Something like this:

@RequestMapping("/user/{uname}")public String doSomething(@PathVariable String username) { ...

Note the difference between "uname" and "username" !There was an exception internally that wasn't raised and I couldn't see it until I set the log to INFO level.