I have written jsp code for generating json .But its not generating exact JsonArray. Its like
[{"item":"747"},,{"item":"1617"},]
instead of
[{"item":"747"},{"item":"1617"}].
below is the code
JSONObject obj = new JSONObject();
JSONArray ja = new JSONArray();
obj.put("item", "747");
ja.put(obj);
obj = new JSONObject();
obj.put("item", "1617");
ja.put(obj);
out.println(ja);