JSON.stringify(js對象數組);
轉成json字符串JSON.stringify($('#formid').serializeObject()),
[b]java端[/b]
一般對象的轉換
final String jsonForm = (String)request.get("formidstr");
final JSONObject obj= JSONObject.fromObject(jsonForm);
String[] dateFormats = new String[] {"yyyy-MM-dd"};
JSONUtils.getMorpherRegistry().registerMorpher(new DateMorpher(dateFormats));
MyObject obj = (MyObject) JSONObject.toBean(obj, MyObject.class);
數組的轉換
net.sf.json.JSONArray
JSONArray dataList = JSONArray.fromObject(json格式的字符串);//如"[{"a":"avalue"},{"b":"bvalue"}]"
dataList 中填充的是Map對象。