rajaa
rajaa

Reputation: 21

Convert Json object into string in java

I got the the Json value from server as

{"User":   
        {"loginId":"Rajaa",
         "firstName":"Rajaa",
         "lastName":"Ramanathan",
         "emailId": "[email protected]",
         "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?

Upvotes: 2

Views: 7958

Answers (2)

irfn
irfn

Reputation: 560

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

Upvotes: 1

Jigar Joshi
Jigar Joshi

Reputation: 240860

You can use GSON, check user guide

Also See

Upvotes: 2

Related Questions