这是我写的一个分页的entry,里面不仅有基本数据类型,还有list类,现在要转换成json格式,要怎么弄?
public class Page {
private int pageNo;
private int totalItem;
private int pageSize;
private String typeId;
private List<DocBean> doc;
}
直接转:
JSONObject page_json=JSONObject.fromObject(page);
出现了一下错误:
net.sf.json.JSONException: There is a cycle in the hierarchy!
后来加了@JsonIgnore 还是报错
DocBean是什么类型,造成了继承循环