Monday, April 21, 2014

Getting json object from response

//protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//
//   request.setCharacterEncoding("utf8");
//   response.setCharacterEncoding("utf8");
//   response.setContentType("application/json");
//   PrintWriter out = response.getWriter();
//   JSONObject jsonObj = (JSONObject) JSONValue.parse(request.getParameter("para"));
//   System.out.println(jsonObj.get("message"));        
//   JSONObject obj = new JSONObject();
//   obj.put("message", "hello from server");
//   out.print(obj);
//
//}
//

No comments:

Post a Comment