JSON.stringify(),org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token(前台向后台传递list)

时间:2023-01-21 19:35:52

1.定义订单实体类

JSON.stringify(),org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token(前台向后台传递list)

2.定义实体类中集合的实体类

JSON.stringify(),org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token(前台向后台传递list)

3.在controller中接收

JSON.stringify(),org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token(前台向后台传递list)

4.前台传递的正确的字段格式(加双引号的)

JSON.stringify(),org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token(前台向后台传递list)

5.而报错的原因就是因为前台在集合中字段格式没有加双引号而报的这个错误

JSON.stringify(),org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token(前台向后台传递list)