Ho to define Filter inside ServletInitializer by using url-mapping
<p>Old style via web.xml:</p>

<pre><code>&lt;filter&gt;
    &lt;filter-name&gt;accessFilter&lt;/filter-name&gt;
    &lt;filter-class&gt;my.app.AccessFilter&lt;/filter-class&gt;
&lt;/filter&gt;
&lt;filter-mapping&gt;
    &lt;filter-name&gt;accessFilter&lt;/filter-name&gt;
    &lt;url-pattern&gt;/admin/*&lt;/url-pattern&gt;
&lt;/filter-mapping&gt;
</code></pre>

<p>How can I achieve the same via the initializer class:</p>

<pre><code>public class AppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

    //...

    @Override
    protected Filter[] getServletFilters() { // nice. thx. url-mapping?
        return new Filter[]{ new AccessFilter() };
    }
}
</code></pre>