qxhuang

Results comments of qxhuang

{"configInfo":[{"type":"appaMonitor","config":[{"name":"serviceCenterDaily","value":{"monitorPeriod":"1","alarmShow":{"submit":"0","submitTarget":"beforehand"},"targetIps":"127.0.0.1/2","statisticsGrain":"10","remark":"","thresholdConfig":{"rate":10,"counts":10,"oper":"and"}}}]}]} 这个json 前端jsp通过post传回来时候spring 直接转换为JSONObject 中的configInfo 节点数据 是ArrayList LinkedHashMap 但是直接用main方法直接转换为 JSONObject configInfo 节点则是JSONArray JSONObject @Bin-mario String str = "{\"configInfo\":[{\"type\":\"appaMonitor\",\"config\":[{\"name\":\"serviceCenterDaily\",\"value\":{\"monitorPeriod\":\"1\",\"alarmShow\":{\"submit\":\"0\",\"submitTarget\":\"beforehand\"},\"targetIps\":\"127.0.0.1/2\",\"statisticsGrain\":\"10\",\"remark\":\"\",\"thresholdConfig\":{\"rate\":10,\"counts\":10,\"oper\":\"and\"}}}]}]}"; JSONObject obj = JSON.parseObject(str); 如何设置才能使前端jsp页面post过来的数据格式和java代码自己转成JSONObje的数据结构是一致的?希望还是原来的JSONArray 而不是 ArrayList