Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.util.ArrayList out of VALUE_STRING token
原因:
页面传参json数组字符串,导致后台spring无法解析,例如:[{“name”: “1”}, {“name”: “2”}]
解决方法:
把json字符串,转换为json对象。
把
{attributes: attributes}
改成
{attributes: JSON.parse(attributes)}
当页面传递的json数组作为字符串时,Spring框架可能无法正确解析,导致MismatchedInputException异常。解决办法是将json字符串转换为json对象,使用JSON.parse()进行解析。
1573

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



