spring filter being invoked for all url's and not matching the url pattern
<p>I am registering a <code>@bean</code> using <code>FilterRegistrationBean</code> in my Spring Boot app with tomcat:</p>

<pre><code>Filter filter = new MyFilter() { ****populate my-header-bean from request***** };

List&lt;String&gt; urlPatterns = new ArrayList&lt;String&gt;();
urlPatterns.add("/hr/*");

FilterRegistrationBean registration = new FilterRegistrationBean();
registration.setFilter(filter);
registration.setUrlPatterns(urlPatterns);
</code></pre>

<p>Even after a <code>urlPattern</code> is specified, the filter is being invoked for all URLs , its behaving like <code>/*</code>. Is there any other way to register a filter for filtering HTTP headers for the URLs matching <code>/hr/*</code>.
Also my-header-bean in the filter to be available as spring-autowire inside my controllers.</p>