// 进行json的属性过滤 PropertyFilter filter = new PropertyFilter() { @Override public boolean apply(Object arg0, String fieldName, Object arg2) { if ("cusPhone".equalsIgnoreCase(fieldName)) { return false; } if ("id".equalsIgnoreCase(fieldName)) { return false; } if ("orders".equalsIgnoreCase(fieldName)) { return false; } return true; } }; // 将集合转化成json格式 String json = JSONArray.toJSONString(pageBean, filter, SerializerFeature.DisableCircularReferenceDetect);