怎么可以获取POST的参数?
有两种方式,可以参考 http://www.codebaoku.com/java/java-index.html: 1. 标准方式接收请求参数
// request为HttpServletRequest对象
BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(request.getInputStream(), 'UTF-8'));
} catch (IOException e) {
e.printStackTrace();
}
String line = null;
StringBuilder sb = new StringBuilder();
try {
while ((line = br.readLine()) != null) {
sb.append(line);
}
br.close();
} catch (IOException e) {
e.printStackTrace();
}
@RequestBody注解接收
@RequestMapping(value = '/technicalReviewInfo', method = RequestMethod.POST,produces = 'application/json;charset=utf-8')
@ResponseBody
public JSONObject synTechnicalReviewInfo(@RequestBody JSONObject technicalReviewJson) {
JSONObject json=new JSONObject();
return json;
}
赞1
踩0