欢迎来到天天文库
浏览记录
ID:57894204
大小:17.32 KB
页数:7页
时间:2020-09-02
《springmvccontroller返回json出错解决.docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、springmvccontroller返回json出错解决1、出错的地方:@RequestMapping(value="/query")@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)public@ResponseBodyJSONObjectquery(@RequestParam("startTime")StringstartTime,@RequestParam("endTime")StringendTime,@RequestParam("oid")Stringoid,@Reques
2、tParam("cid")Integercid,@RequestParam("pay_channel")StringpayChannel,@RequestParam("device_type")StringdeviceType,@RequestParam("phone")Integerphone,@RequestParam("perPage")IntegerpageSize,@RequestParam("skipIndex")IntegerstartIndex)throwsException{ LogInfoinfo=populateQueryP
3、aram(startTime,endTime,oid,cid,payChannel,deviceType,phone,pageSize,startIndex); //总记录数LongtotalCount=logMoniterService.queryLogInfoCount(info); if(totalCount==null){totalCount=0L;} Listlist=logMoniterService.queryLogInfo(info); JSONObjectretData=newJSONObject();retD
4、ata.put("success",true);retData.put("data",list);retData.put("error","");retData.put("totalRecords",totalCount);returnretData;} 2、结果报错:
7、:Objectisnull(throughreferencechain:net.sf.json.JSONObject["data"]->net.sf.json.JSONArray[0]->net.sf.json.JSONObject["createTime"]->net.sf.json.JSONNull["empty"]);nestedexceptionisorg.codehaus.jackson.map.JsonMappingException:Objectisnul
8、l(throughreferencechain:net.sf.json.JSONObject["data"]->
此文档下载收益归作者所有