net.sf.json.JSONException: 'object' is an array. Use JSONArray instead
来源:互联网 发布:海牙国际法院知乎 编辑:程序博客网 时间:2024/06/07 05:11
list集合转换JSON出错误
意思是:对象”是一个数组。使用jsonarray代替。
解决方法:
将JSONObject替换为JSONArray
代码:
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);
JSONArray json = JSONArray.fromObject(newList, jsonConfig);
result = json.toString();
3 4
- net.sf.json.JSONException: 'object' is an array. Use JSONArray instead
- net.sf.json.JSONException: 'object' is an array. Use JSONArray instead
- net.sf.json.JSONException: 'object' is an array. Use JSONArray instead
- net.sf.json.JSONException: Object is null
- net.sf.json.JSONException: Object is null
- net.sf.json.JSONException: Object is null
- net.sf.json.JSONException: Object is null
- net.sf.json.JSONException
- 扰人的异常:net.sf.json.JSONException: Object is null
- net.sf.json.JSONException: There is a cycle in the
- net.sf.json.JSONException: There is a cycle in the
- Exception in thread "main" net.sf.json.JSONException: A JSONArray text must start with '[' at charac
- jQuery调用JSON时,net.sf.json.JSONException: There is a cycle in the hierarchy
- jQuery调用JSON时,net.sf.json.JSONException: There is a cycle in the hierarchy
- json中net.sf.json.JSONException: There is a cycle in the hierarchy!的解决
- Json解析时出现net.sf.json.JSONException: There is a cycle in the hierarchy!42
- jQuery调用JSON时,net.sf.json.JSONException: There is a cycle in the hierarchy
- jQuery调用JSON时,net.sf.json.JSONException: There is a cycle in the hierarchy!
- 如何判断传过来的JSON数据中,某个字段是否存在
- Redis
- Web_PHP_DedeCMS_{dede:arclist}标签不能嵌套包含{dede:global.cfg_templets_skin/},如何解决?
- java术语(PO/POJO/VO/BO/DAO/DTO)
- 大数相加
- net.sf.json.JSONException: 'object' is an array. Use JSONArray instead
- linux僵尸进程产生的原因以及如何避免产生僵尸进程
- ubuntu 安装 sqlite3
- 水晶报表项目运行时 去掉 输入连接数据库密码 的页面
- A. Sereja and Mugs
- 手机定位软件在破案中发挥的作用
- Java工厂模式的精美讲解,讲的非常好
- 多线程(一)_循环接收请求的服务端
- VB.NET自定义标题栏拖动