dhanabalan
10 May 2009, 10:33 PM
Dear all,
When i am doing object.toJSONString i got following format
{"total":"1","data":[{"name":"XYZ","number":"12345"}]}
Please clarifiy this is correct or instead of Double quote need single quote...I don't know....anyone pls tel me...How i will change double quote to single quote...
JSONArray arr = new JSONArray();
JSONObject obj1 = new JSONObject();
obj1.put("number", "12345");
obj1.put("name", "XYZ");
arr.add(obj1);
JSONObject obj2 = new JSONObject();
obj2.put("data",arr);
JSONObject obj3 = new JSONObject();
obj3.put("total","1");
obj3.put("data",arr);
out.println(obj3..toJSONString());
:((
When i am doing object.toJSONString i got following format
{"total":"1","data":[{"name":"XYZ","number":"12345"}]}
Please clarifiy this is correct or instead of Double quote need single quote...I don't know....anyone pls tel me...How i will change double quote to single quote...
JSONArray arr = new JSONArray();
JSONObject obj1 = new JSONObject();
obj1.put("number", "12345");
obj1.put("name", "XYZ");
arr.add(obj1);
JSONObject obj2 = new JSONObject();
obj2.put("data",arr);
JSONObject obj3 = new JSONObject();
obj3.put("total","1");
obj3.put("data",arr);
out.println(obj3..toJSONString());
:((