admin 管理员组文章数量: 887021
2024年1月11日发(作者:position用法css)
{"data": { "promote": [ { "id": 24, "goods_id": 24, "brief": null, "img": { "thumb": "image/1_", "url": "image/1_", "small": "image/1_" }, "market_price": "0.0", "name": "F2000", "promote_price": "", "shop_price": "0.01" }, { "id": 92, "goods_id": 92, "brief": null, "img": { "thumb": "image/1_", "url": "image/1_", "small": "image/1_" }, "market_price": "0.0", "name": "23000", "promote_price": "", "shop_price": "0.01" } ], "player": [ { "action": null, "action_id": null, "description": null, "photo": { "thumb": null, "url": "image/1_", "small": null }, "url": "" }, { "action": null, "action_id": null, "description": null, "photo": { "thumb": null, "url": "image/1_", "small": null }, "url": "" } ]},"status": { "succeed": 1, "error_code": null, "error_desc": null},"paginated": null,"session": null
}4.控制层controller中@Controller@RequestMapping("/moblieHome")public class Moblie_IndexController { @RequestMapping(value = "/hotSale",produces = "text/html;charset=UTF-8") public String mobileHomeCategory(Model model){ String url="xxxxx/home/data"; String homeDataJsonArrayString=Moblie_on(url); JSONObject jsonObject=null; jsonObject= bject(homeDataJsonArrayString); String data=ing("data"); if(data!=null &&()>0){ n("data==="+data); } jsonObject= bject(data); String promote_goods=ing("promote_goods"); if(data!=null &&()>0){ n("promote_goods==="+promote_goods); } JSONArray jsonArray =NArray("promote_goods"); JSONArray jsonArrayImg=null; JSONObject object=null; JSONObject objectImg=null; List
jsp头部注意添加c标签:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@ taglib prefix="t" uri="/tags-tiles"%><%@ taglib prefix="c" uri="/jsp/jstl/core"%>
版权声明:本文标题:java解析Json对象(嵌套json数组) 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/free/1704962537h468220.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论