使用setCycleDetectionStrategy防止自包含
代码:
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);
JSONObject json =JSONObject.fromObject(model, jsonConfig);
使用setCycleDetectionStrategy防止自包含
代码:
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);
JSONObject json =JSONObject.fromObject(model, jsonConfig);