how to get a real null value instead of a JSONObject.NULL value when parsing JSON in grails

后端 未结 3 554
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-19 08:17

I\'m trying to parse some JSON in Grails using the grails.converters.JSON library. I have a field which will contain either a string, or a null value. When I parse the JSON an

3条回答
  •  北荒
    北荒 (楼主)
    2021-02-19 08:54

    You may find this more useful and natural

        JSONObject.NULL.equals(jsonObj.get("key_name"))
    

提交回复
热议问题