Java如何读取网址中的json内容?

http://www.cashl.edu.cn/cashlsearch/search?json={"targetTypes":{"typeCode":"book"},"conditions":[{"logic":"AND","searchType":"INC","term":"b","column":"string_titlefacet"}],"pageUtil":{"currentPage":1,"pageSize":"20"},"maxResult":100}

天涯尽头无女友
浏览 728回答 1
1回答

一只名叫tom的猫

String json = request.getParameter("json");// 以下为获取typeCode的代码JSONObject jsonObject = JSONObject.fromObject(json);JSONObject targetObject = jsonObject.getJSONObject("targetTypes");String type = targetObject.getString("typeCode");System.out.println(type);获取其他属性,以此类推就可以了
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java