1.怎么将jsp页面的数据转换成json格式的数据呢?
怎么将jsp页面的数据转换成json格式的数据呢?
用ajax可以转换。jsp页面的龙城闪客源码数据转换成json格式可以采用js来解析,bookList = new ArrayList<Books>JSONObject json = new JSONObjectjson.accumulate("bookList",js算命源码 bookList);
json.accumulate("pageNum", pageNum);
json.accumulate("totalPages", totalPages);
json.accumulate("totalNum", totalNum);
jsonObj = json.toString();
jsonObj = { "totalNum":5,"bookList":[{ "catGrade":null,"sourceCat":"xx","catProseries":"yy"}, { "catGrade":null,"sourceCat":"yy","catProseries":"xx"}],"totalPages":3,"pageNum":2}
function(data){ //回调函数
var json = eval("("+data+")"); //将数据转换成json类型var bookList = json.bookList ;
alert(bookList[0].catGrade);
2024-11-23 02:17
2024-11-23 01:58
2024-11-23 01:52
2024-11-23 01:29
2024-11-23 01:24
2024-11-23 01:03
2024-11-23 00:41
2024-11-23 00:29