开发者

Convert Json object into string in java

开发者 https://www.devze.com 2023-02-08 05:12 出处:网络
I got the the Json value from server as {\"User\": {\"loginId\":\"开发者_开发百科Rajaa\", \"firstName\":\"Rajaa\",

I got the the Json value from server as

{"User":   
        {"loginId":"开发者_开发百科Rajaa",
         "firstName":"Rajaa",
         "lastName":"Ramanathan",
         "emailId": "raja@yahoo.com",
         "creationDate":"2011-01-25T12:00:00+05:30",
         "lastUpdate":"2011-01-25T12:00:00+05:30",
         "updated":"2"}
}

I want to take loginId,firstName etc as a string.

Can any one help me?


You can use GSON, check user guide

Also See

  • How-do-i-use-googles-gson-api-to-deserialize-json-properly


Use json-simple http://code.google.com/p/json-simple/ check this decoding example http://code.google.com/p/json-simple/wiki/DecodingExamples

0

精彩评论

暂无评论...
验证码 换一张
取 消