Am returning a query from servlet to JSP in JSON format as below.
String json = new Gson().toJson(map3); response.setContentType("application/json")