I am trying to return JSON data with my restlet. I can return a single item\'s JSON with..
import org.json.JSONObject;
Site aSite = new Site().getSite();
JSO
you have to add each item of the array as JSONObject as an index of the arraylist
loop through your arraylist, creating jsonobjects where each element of your Site object is a key,value pair in your jsonobject
and then add that jsonobject in your jsonarray's index
for(int i = 0; i < allsites.length(); i++){
...
}