2017-03-14 18:36
@jcbms2017 可以使用Spring的自定义监听器。web容器一启动就进行一次加载(操作)
2017-03-09 14:08
public String readRequstJson(HttpServletRequest request) {
StringBuffer json = new StringBuffer();
String line = null;
try {
BufferedReader reader = request.getReader();
while ((line = reader.readLine()) != null) {
json.append(line);
}
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(), e);
}
return json.toString();
}
String jsonStr = readRequstJson(getRequest());
JSONObject obj = JSONObject.parseObject(jsonStr);
obj.get("key");
Controller这样取值就好了。obj.get(key)