json字符串转成list集合 Json格式的数据怎么转换成List?

Json格式的数据怎么转换成List? JSONObject.toBeanString列表=请求.getParameter(“json”)JSONArray数据=JSONArray.fromObjec

Json格式的数据怎么转换成List?

JSONObject.toBeanString列表=请求.getParameter(“json”)JSONArray数据=JSONArray.fromObject(列表)对于(int i=0i<data.size文件()i){JSONObject jobj=(JSONObject)数据.get(i) 字符串名称=乔布杰·盖特(“name”)}上述代码将从JSON数组中替换。

怎么把一个list集合转化成json字符串?

List<String> List=新建阵列列表<String>()列表.添加(“测试1”)列表.添加(“测试2”)列表.添加(“测试3”)jsonarray=JSONArray.fromObject(列表)系统输出打印( jsonArray.to字符串())要导入包,需要使用JSON-库.jar, net.sf.json文件JSONArray先生