json串转list集合
List<对象名> ts = (List<对象名>) JSONArray.parseArray(要转换的list, 对象名.class);
对象转json串
String str = JSON.toJSONString(对象);
list集合转字符串
net.sf.json.JsonConfig包
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);
JSONArray json =JSONArray.fromObject(要转换的list, jsonConfig);
前端传给后台数据的双引号可能会被"代替,需转化
json串= json串.replaceAll(""",""");