------解決方案--------------------------------------------------------
去網上下一個json-lib-2.4-jdk15.jar和ezmorph-1.0.6.jar,就能夠調用
List<Map> list = new ArrayList<Map>();
String json = JSONArray.fromObject(list).toString();
------解決方案--------------------------------------------------------
Java code
List<Map<String,String>>
StringBuilder sb = new StringBuilder();
sb.append("{");
for(Map<String,String> map:list){
for (String key : map.keySet()) {
sb.append("\"").append(key).append("\":\"").append(map.get(key))
.append("\"").append(",");
}
}
sb.deleteCharAt(sb.lastIndexOf(","));
sb.append("}");