public JSONObject jsonData() throws Exception {// 读取请求内容BufferedReader br = new BufferedReader(new InputStreamReader(request.getInputStream(), "UTF-8"));String line = null;StringBuilder sb = new StringBuilder();while ((line = br.readLine()) != null) {sb.append(line);}String reqBody = sb.toString();JSONObject json = new JSONObject(reqBody);return json;}public String ok(JSONObject result) throws Exception {PrintWriter pw = response.getWriter();logger.debug(result.toString());pw.print(result.toString());pw.close();return null;}
1200字范文,内容丰富有趣,写作的好帮手!