用json-lib将list对象转成json串时提示"There is a cycle in the hierarchy!"
按照网上的解决方法加JsonConfg配置 JsonConfig config = new JsonConfig();
config.setJavaPropertyFilter(new PropertyFilter(){
public boolean apply(Object arg0, String arg1, Object arg2) {
if(arg1.equals("children")||arg1.equals("parent")){
return true;
}else{
return false;
}
}--但结果还是一样的
实体类Module中有:
private Module parent;
private Set<Module> children = new HashSet<Module>(0);
按照网上的解决方法加JsonConfg配置 JsonConfig config = new JsonConfig();
config.setJavaPropertyFilter(new PropertyFilter(){
public boolean apply(Object arg0, String arg1, Object arg2) {
if(arg1.equals("children")||arg1.equals("parent")){
return true;
}else{
return false;
}
}--但结果还是一样的
实体类Module中有:
private Module parent;
private Set<Module> children = new HashSet<Module>(0);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货