当前位置:   article > 正文

spring boot 控制类 接收前端json数据解析失败_json parse error: cannot deserialize value of type

json parse error: cannot deserialize value of type `org.codehaus.jettison.js

前后端分离,使用String来post json数据时,有可能会导致无法解析。
在这里插入图片描述
Resolved[org.springframework.http.converter.HttpMessageNotReadableException:
JSON parse error: Cannot deserialize value of type java.util.Date from String “2017-
06-08”: not a valid representation (error: Failed to parse Date value ‘2017-06-08’:
Unparseable date: “2017-06-08”); nested exception iscom.fasterxml.jackson.databind.exc.
InvalidFormatException: Cannot deserialize value of type java.util.Date from String
“2017-06-08”: not a valid representation (error: Failed to parse Date value ‘2017-06-08’: Unparseable date: “2017-06-08”)
at [Source: (PushbackInputStream); line: 2, column: 9] (through reference chain: com.team.entity.TimeBean[“date”])]

找了很多办法,如:

  • 在实体类添加@JsonFormat,@DateTimeFormat;
  • application.
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/739463
推荐阅读
相关标签
  

闽ICP备14008679号