2021-05-31 11:05
public void addChat(){
//json数组字符串
String strJson = getPara("chatList","");
if (!avatarService.isJSONArray(strJson) || StringUtils.isEmpty(strJson)){
log.info("批量保存聊天数据错误。{}:不是JSONArray字符串或者为null", strJson);
renderJson(new ResultJson<>(Global.FAIL, "批量保存聊天数据错误"));
return;
}
try{
service.bathList(strJson);
}catch (Exception e){
log.info("保存聊天记录异常!错误信息:" + e.getMessage());
renderJson(new ResultJson<>(Global.FAIL, "批量保存聊天数据失败"));
}
renderJson(new ResultJson<>(Global.OK, "批量保存聊天数据成功"));
}
这个还是一样的错
2021-04-27 15:42
@杜福忠
public class MyHandle extends Handler{
private static Logger log = LoggerFactory
.getLogger(GlobalInterceptor.class);
@Override
public void handle(String s, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, boolean[] booleans) {
String allRequestParams = HttpUtil.getAllRequestParams(httpServletRequest);
log.info("传的参数123:" + allRequestParams);
}
}
2021-04-27 15:42
@杜福忠 heHandlers.add(new ContextPathHandler("base"));
heHandlers.add(new UrlSkipHandler("/monitoring", false));
heHandlers.add(new MyHandle());
这样写,他是不是什么都拦截了,页面显示404.主要是加了第三个handle