/** @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { JSONObject reqJSON = StringUtil.fromReaderToJSON(request.getReader()); JSONObject result = dao.uploadImage(reqJSON); response.setContentType("text/json;charset=UTF-8"); response.getWriter().write(result.toString()); }
/** @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { JSONObject reqJSON = StringUtil.fromReaderToJSON(request.getReader()); Thought t = (Thought) JSONObject.toBean(reqJSON, Thought.class, Thought.loadClassMap()); JSONObject result = dao.postThought(t); response.setContentType("text/json;charset=UTF-8"); response.getWriter().write(result.toString()); }