package mis.config; import mis.interceptor.SpringMVCInterceptor; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @Configuration public class WebAppConfig extends WebMvcConfigurerAdapter { /** * 配置拦截器 */ @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new SpringMVCInterceptor()).addPathPatterns("/**"); } }
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。