public void 메소드(HttpServletRequest request, HttpServletResponse response) throws Exception {
JSONObject jsonObject = new JSONObject();
JSONObject search = new JSONObject();
search.put("name", value);
service.method(search, jsonObject);
response.setContentType("application/x-json; charset=UTF-8");
response.getWriter().print(jsonObject);
}
public void 메소드(JSONObject search, JSONObject jsonObject) throws java.lang.Exception {
List> list = dao.method(search);
if(list != null && list.size() > 0) {
jsonObject.put("data", JSONArray.fromObject(list));
} else {
jsonObject.put("data", null);
}
}