当前位置: 代码迷 >> Java Web开发 >> 。后台打印json前台的easyui却无法识别。
  详细解决方案

。后台打印json前台的easyui却无法识别。

热度:108   发布时间:2016-04-16 21:57:08.0
求助。。。后台打印json前台的easyui却无法识别。。。
Map<String, Object> jsonMap = new HashMap<String, Object>();//定义map 
        jsonMap.put("total", pages.getCountrecord());
        jsonMap.put("rows", pages.getList());
response.getWriter().write(JSONArray.toJSONString(jsonMap));
  后台打印  

另外实体类结构:
private Integer id;
private SysUser sysUser;
private Channel channel;
private String title;
private String subhead;
private String summary;
private String content;
private String thumbnail;
private String author;
private Date createDate;
private Date publishDate;
private Date updateDate;
private String bitIndex;
private String status;
private String attachment;
private String type;
private Integer click;
private String name;
private String address;
private String phone;
private String linkUrl;
private String licenseKey;
private String typeName;
private String video;
private Integer indexNum;
private String froms;


前台easyui  :
<table  class="easyui-datagrid" data-options="rownumbers:true,singleSelect:true,pagination:true,url:'topic/list.yhtml?channelId=${channel.id}',method:'get'">   
    <thead> 
    <tr>
<td data-options="field:'title',align:'center',width:430,autoRowHeight:false">文章标题</td>
<td data-options="field:'indexNum',align:'center',width:430,autoRowHeight:false">置顶排序</td>
<td data-options="field:'createDate',align:'center',width:430,autoRowHeight:false">创建时间</td>
  <td data-options="field:'bitIndex',align:'center',width:430,autoRowHeight:false">是否置顶</td>
<td data-options="field:'click',align:'center',width:430,autoRowHeight:false">点击</td>
<td data-options="field:'controller',align:'center',width:430,autoRowHeight:false">操作</td>
</tr>   
     </thead> 
</table>  


为什么easyui 读不到值啊?  

最后 相应请求所发送过来的值:
{"rows":[{"channel":{"channel":{"channels":[{"$ref":"$.rows[0].channel"},{"channel":{"$ref":"$.rows[0].channel.channel"},"channels":[],"click":0,"id":8,"name":"旅行社","topics":[{"channel":{"$ref":"$.rows[0].channel.channel.channels[1]"},"click":0,"content":"阿萨德22","createDate":1408956028000,"id":579,"thumbnail":"","title":"test22","updateDate":1408956209000},{"channel":{"$ref":"$.rows[0].channel.channel.channels[1]"},"click":0,"content":"<span style=\"font-size:20px;line-height:36px;display:block;padding-bottom:10px;\">新华国际旅游社</span>","createDate":1409031740000,"id":583,"thumbnail":"","title":"新华国际旅游社","updateDate":1409031952000}]},{"channel":{"$ref":"$.rows[0].channel.channel"},"channels":[],"click":0,"id":9,"name":"星级酒店","topics":[{"channel":{"$ref":"$.rows[0].channel.channel.channels[2]"},"click":0,"content":"开房低至3折<br />","createDate":1409126265000,"id":585,"title":"蓝天宾馆"}]},{"channel":{"$ref":"$.rows[0].channel.channel"},"channels":[],"click":0,"id":10,"name":"经济型酒店","topics":[]}],"click":0,"id":4,"name":"旅游服务","topics":[]},"channels":[],"click":0,"id":7,"name":"杨浦景点","topics":[{"$ref":"$.rows[0]"},{"channel":{"$ref":"$.rows[0].channel"},"click":0,"content":"我上传了视频0000<br />","createDate":1409030695000,"id":581,"title":"SMP滑板公园","updateDate":1409542714000},{"channel":{"$ref":"$.rows[0].channel"},"click":0,"content":"<p>\r\n	asdasdas诗圣杜甫\r\n</p>\r\n<p>\r\n	fsdfsdfsdfsdfsd\r\n</p>\r\n<p>\r\n	发送到发送到\r\n</p>\r\n<p>\r\n	士大夫似的\r\n</p>","createDate":1409030881000,"id":582,"thumbnail":"","title":"创智天地","updateDate":1409192268000,"video":"/Yply//video/upload/1730d7bc56704f8babaa2c6a9153cb671409192267837.flv"},{"channel":{"$ref":"$.rows[0].channel"},"click":0,"content":"<p>\r\n	士大夫似的sdfsdfsdfsd\r\n</p>\r\n<p>\r\n	f\r\n</p>\r\n<p>\r\n	fsdfsdfs的sdf丰盛的\r\n</p>\r\n<p>\r\n	发生的方式\r\n</p>\r\n<p>\r\n	<br />\r\n</p>\r\n<p>\r\n	范德萨发生的\r\n</p>\r\n<p>\r\n	<br />\r\n</p>\r\n<p>\r\n	士大夫似的\r\n</p>","createDate":1409032725000,"id":584,"thumbnail":"","title":"黄兴公园","updateDate":1409130991000},{"channel":{"$ref":"$.rows[0].channel"},"click":0,"content":"test","createDate":1409562818000,"id":595,"thumbnail":"/Yply//images/upload//90d5b99aaccb44e6a3cd43ebb3c108931409562835990.jpg","title":"test "},{"channel":{"$ref":"$.rows[0].channel"},"click":0,"content":"报表","createDate":1409642072000,"id":598,"title":"发","video":"/Yply//video/upload//a39fed3550ba456e80e043abdc9acbed1409642072297.mp4"},{"channel":{"$ref":"$.rows[0].channel"},"click":0,"content":"反倒是","createDate":1409642218000,"id":599,"title":"发送到发送到","video":"/Yply//video/upload//782280ed9dcd43c5bdf999eb9f15c5841409642218771.mp4"}]},"click":0,"content":"过的法规的","createDate":1408956587000,"id":580,"thumbnail":"","title":"财富大酒店","updateDate":1409126061000},{"$ref":"$.rows[0].channel.topics[1]"},{"$ref":"$.rows[0].channel.topics[2]"},{"$ref":"$.rows[0].channel.topics[3]"},{"$ref":"$.rows[0].channel.topics[4]"},{"$ref":"$.rows[0].channel.topics[5]"},{"$ref":"$.rows[0].channel.topics[6]"}],"total":7}

------解决方案--------------------
返回的JSON格式有问题
  相关解决方案