Example #1
0
 @Override
 public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
     throws Exception {
   System.out.println(this.getClass().getSimpleName() + "---preHandle()...");
   long beginTime = System.currentTimeMillis();
   starTimeThreadLocal.set(beginTime);
   return super.preHandle(request, response, handler);
 }
  @Override
  public boolean preHandle(
      HttpServletRequest _request, HttpServletResponse _response, Object _handler)
      throws Exception {
    // TODO Auto-generated method stub

    String uri = _request.getRequestURI();
    System.out.println(uri);

    long beginTime = System.currentTimeMillis(); // 1、开始时间
    startTimeThreadLocal.set(beginTime); // 线程绑定变量(该数据只有当前请求的线程可见)	
    if (_handler instanceof HandlerMethod) {
      log.info("--------------------------");
      HandlerMethod hm = (HandlerMethod) _handler;
      Method method = hm.getMethod();
      TypeVariable[] tvs = method.getTypeParameters();
      Type[] types = method.getGenericParameterTypes();
      log.info("--------------------------");
    }
    boolean rtn = super.preHandle(_request, _response, _handler);

    log.info(rtn);
    return rtn;
  }