//在controller 中, 引用该方法,返回一个json对象 Map<String, Object> data = customService.loadindividualStyle(searchMap);(该方法中 for 循环封装实体类, 重复封装了一个 对象,) 遇到问题, 返回的json对象出现$ref{对象,地址值,} 解决方法:!!! //转换json对象,防止重复引用 String json = JSON.toJSONString(data,SerializerFeature.DisableCircularReferenceDetect); JSONObject jsStr = JSONObject.parseObject(json); //最后将json对象返回 return new DzResult(200,"",jsStr);
问题解决!! 不在出现对象重复引用问题