获取前台传递信息
/** * 获取前台向URL传递的数据 */ // FIXME TODO XXX 获取前台传递的json字符串 public void getJSONParam(HttpServletRequest request){ JSONObject jsonParam = null; try { // 获取输入流 BufferedReader streamReader = new BufferedReader(new InputStreamReader(request.getInputStream(), "UTF-8")); // 写入数据到Stringbuilder StringBuilder sb = new StringBuilder(); String line = null; while ((line = streamReader.readLine()) != null) { sb.append(line); } // 直接将json信息打印出来 System.out.println(sb.toString()); } catch (Exception e) { e.printStackTrace(); } }
血肉苦弱机械飞升 :痛苦预示着超脱
本文来自博客园,作者:血肉苦弱机械飞升,转载请注明原文链接:https://www.cnblogs.com/supperlhg/p/9328072.html