前台使用ajax 给后台传递 JSON串:
dataType: "json",
traditional:true,
data:{
sentDatas:JSON.stringify(sentDatas)
},
后台解析前台穿的JSON数据:
JSONObject jsonObject = JSONObject.fromObject(dataRow);
String itemString = jsonObject.getString("items");
JSONArray myJsonArray = JSONArray.fromObject(itemString);
JSONObject searchList = (JSONObject) myJsonArray.get(0);
后台给前台返回JSON串:
return JSONObject.fromObject(SearchResult).toString();