1.开发中常用到json字符串和list转换
js中传入的参数JSON.stringify({"data":datas });
params为传入的json字符串参数
String data = params.getString("data");
List<Object> obejctList =JSONArray.parseArray(data,Object.class);
2.json字符串转Object
JSONObject json = new JSONObject();
Object obj = JSON.parSEObject(json.getString("data"),Object.class);
原文链接:https://www.f2er.com/json/288773.html