When you need to convert a string into a json array and traverse the contents.
First, import the two jar packages net.sf.json.JSONArray and net.sf.json.JSONObject
String str = "[{name:'a',value:'aa'},{name: 'b',value:'bb'},{name:'c',value:'cc'},{name:'d',value:'dd'}]" ; // An unconverted string
JSONArray json = JSONArray.fromObject(str ); // First convert the string into a JSONArray object
if(json.size()>0){
for(int i=0;i
System.out.println(job.get("name")+"="); / / Get the attribute value in each object
}
}