title: How to apply spring boot filter based on URL pattern?
body: <p>I have created a spring boot filter - implements <code>GenericFilterBean</code> with <code>@Component</code> annotation.</p>
  
  <pre><code>@Component 
  public class MyAuthenticationFilter  extends GenericFilterBean {
  ...
  @Override
  public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
  ...
  }
  }
  </code></pre>
  
  <p>The filter is automatically identified by the Spring Boot Framework and works fine for all of the REST API. I want this filter to apply only on a certain URL path, such as <code>/api/secure/*</code> but I can't find the right way.
  I tried <code>@WebFilter</code> but it didn't work. 
  I'm not using XML configuration or servlet initializer - just the annotations.</p>
  
  <p>What would be the correct way to get it working?</p>