package com.liuil.web.interceptor;

import java.util.logging.Logger;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

@Component
public class LoginInterceptor implements HandlerInterceptor{
  public static Logger logger = Logger.getLogger(HandlerInterceptor.getClass());

  @Override
  public  boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws  Exception{
    logger.info("preHandler is called");
  }

}

package com.liuil.web.interceptor;

import java.util.logging.Logger;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

@Component
public class LoginInterceptor extends HandlerInterceptorAdapter {
  //public static Logger logger = Logger.getLogger(LoginInterceptor.getClass());

  @Override
  public  boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws  Exception{
    //logger.info("preHandler is called");
    return true;
  }

}

修改Login Interceptor