'object' is an array. Use JSONArray instead

时间:2017-11-19 15:30:38   收藏:0   阅读:550

错误是:对象是一个数组,使用JSONArray代替

错误代码为:JSONObject json=JSONObject.fromObject(usertypeList);
 正确代码为:JSONArray json=JSONArray.fromObject(usertypeList); 

注意:JSONObject只是单个java对象转化json对象      

原文:http://www.cnblogs.com/sllcom/p/7859731.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!