Use json-lib, a library which adds JSON support to any Java program. json-lib can take a String and turn it into a JSONObject which can then be used to retrieve specific attributes. 1. Add this dependency to your project: <dependency>
<groupId> net.sf.json-lib </groupId>
<artifactId> json-lib </artifactId>
<version> 2.3 </version>
<scope> compile </scope>
</dependency> What does this mean? See How to Add a Dependency to a Java Project 2. Put the following JSON sample in your classpath: { 'foo' : 'bar' ,
'coolness' : 2.0 ,
'altitude' : 39000 ,
'pilot' :{ 'firstName' : 'Buzz' ,
'lastName' : 'Aldrin' },
'mission' : 'apollo 11' } 3. Load the resource from the classpath and parse this JSON as follows: package com . discursive . answers ;
imp...