title: Annotation for applying filter in spring-boot to specific url patterns
body: <p>I am developing a spring-boot rest service which contains two filters (implementing the <code>javax.servlet.Filter</code> interface). While one filter should apply to all url patterns I want to configure the second filter to only apply to the url pattern <code>/api/*</code>.</p>
  
  <p>Currently I am doing this by using following code:</p>
  
  <pre class="lang-java prettyprint-override"><code>@SpringBootApplication
  public class Application
  {
      public static void main(String[] args)
      {
          SpringApplication.run(Application.class, args);
      }
  
      @Bean
      public FilterRegistrationBean filterRegistrationBean() {
          FilterRegistrationBean registrationBean = new FilterRegistrationBean();
          SecurityFilter securityFilter = new SecurityFilter();
          registrationBean.setFilter(securityFilter);
          registrationBean.addUrlPatterns("/api/*");
  
          return registrationBean;
      }
  }
  </code></pre>
  
  <p>But my question is if there is an annotation to do the same, considering there are annotations for setting the order of filters (<code>@Order(..)</code>). I have tried using <code>javax.servlet.annotation.WebFilter</code> but spring-boot does seem to ignore this annotation.</p>