Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. {"Key1":"Value1","Key2":{"innerJSonKey":"innerJSonValue"}} this is the jsonobject which is converted to String using toString().
  2. **JSON Simple**
  3. JSONParser jp = new JSONParser();
  4. JSONObject jo = (JSONObject)jp.parse(jsonString);
  5. JSONObject innerjson = (JSONObject)jo.get("innerJSonKey"); -- this pretty much works
  6.  
  7. ObjectMapper mapper = new ObjectMapper();
  8. JSONObject jo = mapper.readValue(jsonString,JSONObject.class);
  9. JSONObject innerjson = (JSONObject)jo.get("innerJSonKey"); -- **But this step is failing**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement