POST提交异常 JsonParseException

来源:互联网 发布:php beast 怎么用 编辑:程序博客网 时间:2024/04/30 11:33


POST提交,报以下异常,

"Could not read document: Unrecognized token 'userid': was expecting ('true', 'false' or 'null')↵ at [Source: java.io.PushbackInputStream@1fd46bc; line: 1, column: 8]; nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'userid': was expecting ('true', 'false' or 'null')↵ at [Source: java.io.PushbackInputStream@1fd46bc; line: 1, column: 8]"


先说说我的框架,我用的是ajax提交,后台是springboot,

这里面涉及到:

@Controller和@RestController的区别,具体不详细介绍。
@ResponseBody跟@Controller这个一起用的
我这里使用了@RestController,所以导致以上报错,
要解析页面,需要用@Controller