fastjson 返回对象解析引用问题
r e f : " ref: " ref:".list[0].blogger" 不显示数据
循环引用:当一个对象包含另一个对象时,fastjson就会把该对象解析成引用。
@ResponseBody
@RequestMapping("/yibushow")
public String yibushow(@RequestParam(value=“pn” ,defaultValue = “1”)Integer pn, ModelMap map){
PageHelper.startPage(pn,10);
List list = blogSevice.getBlogs();
PageInfo pageInfo = new PageInfo(list);
*String json = JSON.toJSONString(pageInfo); *修改为加粗出
return json;
}
修改之后
@ResponseBody
@RequestMapping("/yibushow")
public String yibushow(@RequestParam(value=“pn” ,defaultValue = “1”)Integer pn, ModelMap map){
PageHelper.startPage(pn,10);
List list = blogSevice.getBlogs();
PageInfo pageInfo = new PageInfo(list);
String json = JSON.toJSONString(pageInfo, SerializerFeature.DisableCircularReferenceDetect);
return json;
修改之后显示作者和类型