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
本文探讨了使用Spring Boot框架处理Ajax提交时遇到的JSON解析异常问题,并介绍了如何正确配置控制器来避免这类错误。

9316

被折叠的 条评论
为什么被折叠?



