Converting JSON data to Java object

后端 未结 12 1116
春和景丽
春和景丽 2020-11-21 05:11

I want to be able to access properties from a JSON string within my Java action method. The string is available by simply saying myJsonString = object.getJson()

12条回答
  •  -上瘾入骨i
    2020-11-21 05:36

    If, by any change, you are in an application which already uses http://restfb.com/ then you can do:

    import com.restfb.json.JsonObject;
    
    ...
    
    JsonObject json = new JsonObject(jsonString);
    json.get("title");
    

    etc.

提交回复
热议问题