JSON parse error: Unrecognized token 'undefined': was expecting ('true', 'false' or 'null')處理


1.報錯:

JSON parse error: Unrecognized token 'undefined': was expecting ('true', 'false' or 'null'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'undefined': was expecting ('true', 'false' or 'null') at [Source: java.io.PushbackInputStream@655a8572; line: 1, column: 11]

2.分析:

很明顯是json轉換出問題,所以把問題范圍限制在了前端。

3.處理:

使用JSON.Stringfy()將JavaScript 值轉換為 JSON 字符串傳到后台,報錯解決。

4.后記:

此問題發生於你所傳的的參數中含有數組或集合


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM