假设返回报文为: 对应字符串: {"customer": [{"controlLevel": "13013001","commonRegionName": "集团","createDate": "","custId": "4164275","partyNumber ...
用 alibaba 的 fastjson 将 list 或 map 转为 json 字符串。不用 net.sf.json.JSONObject 或者 net.sf.json.JSONArray。写法: lt dependency gt lt groupId gt com.alibaba lt groupId gt lt artifactId gt fastjson lt artifactId gt ...
2021-01-28 21:49 0 329 推荐指数:
假设返回报文为: 对应字符串: {"customer": [{"controlLevel": "13013001","commonRegionName": "集团","createDate": "","custId": "4164275","partyNumber ...
//先将字符串转为list 集合 json字符串linkConfJson ...
1.直接用fastjson的静态方法string JSON.toJSONString(list)方法就行,JSON.toJSONString(list)将java list转为json字符串。 2.toJsonString()方法,有两个重载,一个是JSON.toJsonString(list ...
1、代码 ...
json对象字符串,公认, 是对应Map<String, Object> json数组字符串,也是公认的,对应List<Map<String, Object>>或者List<String> 这边的Object可以是string, 数字,对象 ...
...
亲测可行,如下: 用的是阿里巴巴的fastjson, 其中,jsonstr指的是list类型的json字符串:例如:[{"name":"xxx","age":12},{"name":"zzz","age":15}] ...
net.sf.json.JSONObject; /** * 说明 json字符串 转成 Map/List * @autho ...