jsp前端页面如何解析json数据?

如题,现有一jsp页面,需要解析并显示后台传过来的json数据,json数据如下:{"button":[{"name":"课程服务","sub_button":[{"na... 如题,现有一jsp页面,需要解析并显示后台传过来的json数据,json数据如下:
{"button":[{"name":"课程服务","sub_button":[{"name":"课程一","type":"view","url":"http://www.baidu.com","sub_button":[]},{"name":"课程二","type":"click","url":"ccc","sub_button":[]},{"name":"课程三","type":"view","url":"http://www.baidu.com","sub_button":[]},{"name":"课程四","type":"view","url":"http://www.qq.com","sub_button":[]},{"name":"课程五","type":"click","url":"eee","sub_button":[]}]},{"name":"活动信息","sub_button":[{"name":"活动一","type":"click","url":"aaa","sub_button":[]},{"name":"活动二","type":"view","url":"http://www.baidu.com","sub_button":[]},{"name":"活动三","type":"view","url":"http://www.baidu.com","sub_button":[]},{"name":"活动四","type":"view","url":"http://www.qq.com","sub_button":[]},{"name":"活动五","type":"click","url":"fff","sub_button":[]}]},{"name":"项目信息","sub_button":[{"name":"项目一","type":"click","url":"bbb","sub_button":[]},{"name":"项目二","type":"click","url":"ddd","sub_button":[]},{"name":"项目三","type":"view","url":"http://www.baidu.com","sub_button":[]},{"name":"项目四","type":"view","key":"course","sub_button":[]},{"name":"项目五","type":"click","key":"ggg","sub_button":[]}]}]}
页面显示格式如下图:

请问如何达到这种效果,结果正确可再加20分。
json字符串可以使用js,jquery,ajax,java这几种技术,页面为jsp页面,json数据为java后台传递来。
展开
 我来答
zhang779896660
2014-03-09 · TA获得超过701个赞
知道小有建树答主
回答量:717
采纳率:100%
帮助的人:339万
展开全部
如果是AJAX传来的JSON 最好是用JQUERY 指定一下就可以了啊

而且如果是局部刷新的话更好, 返回的就是一个data
就可以 data[1].name 这样取值了, 具体的你看一下jquery的文档就好 很简单
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式