ssh struts2 json 异常
ssh struts2 json 错误JSON处理Hibernate实体类net.sf.json.JSONException: There is a cycle in the hier
ssh struts2 json 错误
JSON处理Hibernate实体类net.sf.json.JSONException: There is a cycle in the hierarchy异常
文章分类:Java编程
<SPAN?style="FONT-SIZE:?medium">TProcessInfoDAO?dao?=?new?TProcessInfoDAO(); ???????????List<TProcessInfo>?orgData?=?dao.findAll(); ??????????JsonConfig?config?=?new?JsonConfig();???? ???????????config.setIgnoreDefaultExcludes(false);??????? ???????????config.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT); ???????????//调用ExtHelper将你的JSONConfig传递过去 ???????????JSONArray?JsonArr=JSONArray.fromObject(orgData,?config); ???????????String?jsonstr=JsonArr.toString(); ???????????System.out.println(jsonstr);</SPAN>??