2021-06-03 20:38

@杜福忠 本地没有问题,线上就报错,这个和请求的方式有关吗?

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

2021-03-29 20:59

@zzutligang 好的,谢谢,手动调一下renderJson就好了

2021-03-29 18:24

怎么让她不报错,又能正确返回boolean值?拦截器模板现在不改了?