![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JSON
zuihongyan518
一个小白的打怪晋级的过程
展开
-
Exception in thread "main" com.alibaba.fastjson.JSONException: autoType is not support. com.exa.demo
将类反序列化的时候,报错:再网上查询了一些资料,现在推荐几个网址供大家参考:http://www.tinygroup.org/docs/3281429682083150397https://github.com/alibaba/fastjson/wiki/enable_autotype大体原因就是使用fastjson的时候:序列化时将class信息写入,反解析的时候,fastjson默认情况下会开...原创 2018-07-11 15:10:29 · 1840 阅读 · 0 评论 -
Exception in thread "main" java.lang.ClassCastException: com.alibaba.fastjson.JSONObject cannot be..
在对peopleJson反序列化时候报错:Exception in thread "main" java.lang.ClassCastException: com.alibaba.fastjson.JSONObject cannot be cast to com.exa.demo2.PO.PeopleInfoPO问题是因为:在使用String peopleJson = JSON.toJSONStr...原创 2018-07-11 16:15:23 · 12101 阅读 · 0 评论 -
SpringMVC中controller接收json数据的方法
注意:1.在发送数据时,data键的值一定要写成JSON.stringify(json),将数据转换成json格式,否则会抛出异常2.basePath是项目根目录:<%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServ...原创 2019-01-10 13:21:19 · 963 阅读 · 0 评论 -
JSON转对象,对象转JSON
需要的jar包: 工具包为阿里fastjson <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.44</ver...原创 2019-09-11 18:48:12 · 126 阅读 · 0 评论