@ServletComponentScan

@ServletComponentScan功能:

Servlet、Filter、Listener 可以直接通过 @WebServlet、@WebFilter、@WebListener 注解自动注册

 

@ServletComponentScan

@SpringBootApplication
@ServletComponentScan
public class RateLimiterApplication {

    public static void main(String[] args){
        SpringApplication.run(RateLimiterApplication.class, args);
    }

}

@WebFilter 

@WebFilter(urlPatterns = "/*", filterName = "rateLimiterFilter")
public class RateLimiterFilter implements Filter {

    

}

 

你可能感兴趣的:(springboot)