在对result进行json转换时,new Gson().toJson(result),遇到null值不进行转换问题,网上搜了下,使用GsonBuilder创建Gson即可解决,代码如下: 

Gson gson = new GsonBuilder() 
.serializeNulls() 
.create(); 

相关文章:

  • 2021-04-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2021-05-26
  • 2022-02-10
  • 2022-12-23
相关资源
相似解决方案