<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>fastjson</artifactId>
    <version>1.2.71</version>
</dependency>


import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;

String s = JSONObject.toJSONString(对象,SerializerFeature.WriteMapNullValue);
posted on 2022-10-11 11:49  田坤坤  阅读(42)  评论(0编辑  收藏  举报