//这种方式会自动剔除掉为null数据 String stg = JSON.toJSONString(list) //后面加上SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue 就不会过滤空值字段了 String stg = JSON.toJSONString(list,SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue)
//这种方式会自动剔除掉为null数据 String stg = JSON.toJSONString(list) //后面加上SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue 就不会过滤空值字段了 String stg = JSON.toJSONString(list,SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue)
转载于:https://www.cnblogs.com/yanchaohui/p/10985804.html