可以在Spring Boot项目中配置自定义SpringMVC拦截器
- 编写拦截器(实现HandlerInterceptor);
package li.chen.com.interceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Slf4j
public class