images = new LinkedList<Image>();
}
// Create Json response
JsonObject rsp = new JsonObject();
JsonArray imgList = new JsonArray();
JsonArray thumbList = new JsonArray();
// Get the image specific data
for (Image img : images) {
JsonObject im = new JsonObject();
JsonObject th = new JsonObject();
im.addParameter(Configuration.urlParam, cfg.getImageRootUrl(request)
+ img.getDirectory().getPath() + "/" + img.getName());
imgList.addItem(im);
th.addParameter(Configuration.urlParam, cfg.getImageRootUrl(request)
+ img.getDirectory().getPath() + "/"
+ Configuration.thumbDirName + "/" + img.getName());
thumbList.addItem(th);
}
rsp.addParameter(Configuration.imgListParam, imgList);
rsp.addParameter(Configuration.thumbListParam, thumbList);
getServletContext().log("Json response: " + rsp.toString());
// Reply the Json response