后台:
List<PageData> KeyWords=plantDefDetailCSAService.findKeyWords(pd);
JSONArray array = new JSONArray();
JSONArray KeyWordsList = array.fromObject(KeyWords);
mv.addObject("KeyWordsList",KeyWordsList);
前台:
var partList = jQuery.parseJSON( '${KeyWordsList}');
$.each(partList,function(key,value){
console.log(key);
console.log(value['ID']+' '+value['KeyWord']);
});
测试数据:
结果: