@Override
 public void afterCompletion(
     HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
     throws Exception {
   System.out.println("CachingInterceptor.afterCompletion()");
   super.afterCompletion(request, response, handler, ex);
 }
  /*
   * (non-Javadoc)
   * @see org.springframework.web.servlet.handler.HandlerInterceptorAdapter#afterCompletion(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, java.lang.Exception)
   */
  @Override
  public void afterCompletion(
      HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
      throws Exception {

    super.afterCompletion(request, response, handler, ex);
  }
 @Override
 public void afterCompletion(
     HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
     throws Exception {
   logger.info("After rendering the view");
   super.afterCompletion(request, response, handler, ex);
 }
  @Override
  public void afterConcurrentHandlingStarted(
      HttpServletRequest _request, HttpServletResponse _response, Object _handler)
      throws Exception {
    // TODO Auto-generated method stub

    super.afterConcurrentHandlingStarted(_request, _response, _handler);
  }
Beispiel #5
0
 @Override
 public void afterCompletion(
     HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
     throws Exception {
   if (logger.isDebugEnabled()) {
     logger.debug("end access " + request.getRequestURI());
   }
   super.afterCompletion(request, response, handler, ex);
 }
 @Override
 public void postHandle(
     HttpServletRequest request,
     HttpServletResponse response,
     Object handler,
     ModelAndView modelAndView)
     throws Exception {
   System.out.println("ProjectPublishInterceptor:postHandle");
   super.postHandle(request, response, handler, modelAndView);
 }
Beispiel #7
0
 @Override
 public void postHandle(
     HttpServletRequest request,
     HttpServletResponse response,
     Object handler,
     ModelAndView modelAndView)
     throws Exception {
   System.out.println(this.getClass().getSimpleName() + "---postHandle()...");
   super.postHandle(request, response, handler, modelAndView);
 }
  /*
   * (non-Javadoc)
   * @see org.springframework.web.servlet.handler.HandlerInterceptorAdapter#postHandle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.web.servlet.ModelAndView)
   */
  @Override
  public void postHandle(
      HttpServletRequest request,
      HttpServletResponse response,
      Object handler,
      ModelAndView modelAndView)
      throws Exception {

    super.postHandle(request, response, handler, modelAndView);
  }
 @Override
 public void postHandle(
     HttpServletRequest request,
     HttpServletResponse response,
     Object handler,
     ModelAndView modelAndView)
     throws Exception {
   logger.info("After handling the request");
   super.postHandle(request, response, handler, modelAndView);
 }
Beispiel #10
0
 @Override
 public void afterCompletion(
     HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
     throws Exception {
   System.out.println(this.getClass().getSimpleName() + "---afterCompletion()...");
   long endTime = System.currentTimeMillis();
   long beginTime = starTimeThreadLocal.get();
   long consumeTime = endTime - beginTime;
   System.out.println("consumeTime=" + consumeTime);
   super.afterCompletion(request, response, handler, ex);
 }
  @Override
  public void postHandle(
      HttpServletRequest _request,
      HttpServletResponse _response,
      Object _handler,
      ModelAndView _modelAndView)
      throws Exception {
    // TODO Auto-generated method stub
    super.postHandle(_request, _response, _handler, _modelAndView);

    log.info(_handler);
  }
 @Override
 public void postHandle(
     HttpServletRequest request,
     HttpServletResponse response,
     Object handler,
     ModelAndView modelAndView)
     throws Exception {
   Long startTime = (Long) request.getAttribute("startTime");
   Long requestTime = System.currentTimeMillis() - startTime;
   request.setAttribute("requestTime", requestTime);
   super.postHandle(request, response, handler, modelAndView);
 }
  public void postHandle(
      HttpServletRequest request,
      HttpServletResponse response,
      Object handler,
      ModelAndView modelAndView)
      throws Exception {

    ArrayList array = (ArrayList) request.getAttribute("interceptor");
    array.add("TwoInterceptor.postHandle");
    request.setAttribute("interceptor", array);
    super.postHandle(request, response, handler, modelAndView);
  }
  @Override
  public void afterCompletion(
      HttpServletRequest _request, HttpServletResponse _response, Object _handler, Exception _ex)
      throws Exception {
    // TODO Auto-generated method stub

    long endTime = System.currentTimeMillis(); // 2、结束时间
    long beginTime = startTimeThreadLocal.get(); // 得到线程绑定的局部变量(开始时间)
    long consumeTime = endTime - beginTime; // 3、消耗的时间
    // System.out.println(consumeTime);
    if (consumeTime > 500) { // 此处认为处理时间超过500毫秒的请求为慢请求
      System.out.println(
          String.format("%s consume %d millis", _request.getRequestURI(), consumeTime));
    }
    log.info(_ex);
    super.afterCompletion(_request, _response, _handler, _ex);
  }
Beispiel #15
0
 @Override
 public void afterConcurrentHandlingStarted(
     HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
   System.out.println(this.getClass().getSimpleName() + "---afterConcurrentHandlingStarted()...");
   super.afterConcurrentHandlingStarted(request, response, handler);
 }
  /*
   * (non-Javadoc)
   * @see org.springframework.web.servlet.handler.HandlerInterceptorAdapter#afterConcurrentHandlingStarted(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object)
   */
  @Override
  public void afterConcurrentHandlingStarted(
      HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

    super.afterConcurrentHandlingStarted(request, response, handler);
  }