}
}
private void listeVolHistoric(HttpServletRequest request,HttpServletResponse response) throws IOException {
try {
Cache cache = DatacacheSingleton.getInstance();
PreparedQuery preparedHistoricQuery = VolDAO.getSearchVol((String)cache.get("leavingFrom"),(String)cache.get("goingTo"),(Date)cache.get("departure"));
JSONObject search = new JSONObject();
search.put("leaving", (String)cache.get("leavingFrom"));
search.put("going", (String)cache.get("goingTo"));
search.put("time", new SimpleDateFormat("HH:mm").format((Date)cache.get("departure")));
search.put("date", new SimpleDateFormat("yyyy-MM-dd").format((Date)cache.get("departure")));
cache.clear();
JSONArray volHistoricList = new JSONArray();
volHistoricList.put(search);
for(Entity result : preparedHistoricQuery.asIterable())
{
JSONObject vol = new JSONObject();