The request sent by the client was syntactically incorrect.-Spring MVC + JDBC Template

前端 未结 6 1667
攒了一身酷
攒了一身酷 2020-11-29 05:52

I am newbie to Spring MVC. I was stuck by an error while running my project Error-The request sent by the client was syntactically incorrect. I have an enti

6条回答
  •  再見小時候
    2020-11-29 06:53

    This happens when the defined binding does not match to what the user is sending. The most common issues are:

    • Missing PathVariable declaration
    • Incomplete PathVariable declaration (for example missing value="variableName")
    • Wrong data type, such as Sotirios Delimanolis answer above. If the Class of an input parameter cannot be serialized the request is not processable

    So, in general, be sure that:

    • Each PathVariable is declared
    • A value is assigned that corresponds to value to be match in the path - @PathVariable(value="myVariableName", String myVariable) where the path defines @RequestMapping(value = "/userInfo/myVariableName", method = RequestMethod.GET)
    • Each class declared for a PathVariable must be serializable.

提交回复
热议问题