if (resolveJson && controller.isJsonRequest()) { // 注入 JsonRequest 包装对象接管 request controller.setHttpServletRequest(jsonRequestFactory.apply(controller.getRawData(), controller.getRequest())); }
这地方直接截胡了。。
之前使用的自定义handel无法通过request去获取params
public class RequestContextHandler extends Handler { @Override public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) { try { RequestContext.handle(request, response); doHandle(target, request, response, isHandled); } finally { RequestContext.release(); } } private void doHandle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) { request.setAttribute(CommonConsts.attrRequest, request); next.handle(target, request, response, isHandled); } } 无法使用ThreadLocal存放了。。 private static ThreadLocal<HttpServletRequest> requests = new ThreadLocal<>();
项目:JFinal