@RequestMapping(value = "/ajaxAddMenuForm.do") public void ajaxAddMenuForm( HttpServletRequest request, HttpServletResponse response, String restntId, MenuDTO menuDto) throws IOException { System.out.println("/ajaxAddMenuForm.do"); System.out.println(restntId); String lastMenuId = menuService.getLastMenuId(restntId); String newMenuId = menuIdGen(lastMenuId, restntId); menuDto.setMenuId(newMenuId); menuDto.setRestntId(restntId); menuService.addMenuForm(menuDto); // 제이슨으로 변환 JSONObject jsonObject = JSONObject.fromObject(menuDto); System.out.println("json - " + jsonObject); response.setContentType("text/html; charset=utf-8"); PrintWriter out = response.getWriter(); out.print(jsonObject.toString()); }