日期:2014-05-16  浏览次数:20375 次

JAVA to JSON 避免循环引用造成死循环
JsonConfig config = new JsonConfig();
config.setJsonPropertyFilter(new PropertyFilter() {
public boolean apply(Object source, String name, Object value) {
if (name.equals("form") || name.equals("formElm") ) {
return true;
} else {
return false;
}
}
});

JSONObject jsonObject = JSONObject.fromObject( form, config );