title: @WebFilter vs. <Filter> in web.xml
body: <p>I wonder how I can achieve a behaviour like using this @WebFilter annotation </p>
  
  <pre><code>@WebFilter(
      urlPatterns = "/*",
      filterName = "AuthenticationFilter",
      description = "Filter all URLs"
      ,
      initParams = {
  @WebInitParam(name = "unprotectedUrls", value = "/,/login,/authentication,/notification,/sdr")})
  public class AuthenticationFilter implements Filter {
  ...}
  </code></pre>
  
  <p>(which works well, meaning that I don't have to be logged in only for the listed paths but for all other paths I have to be)...
  by using a &lt;filter&gt; element in web.xml. </p>
  
  <p>Using this filter in web.xml:</p>
  
  <pre><code>    &lt;filter&gt;
          &lt;filter-name&gt;AuthenticationFilter&lt;/filter-name&gt;
          &lt;filter-class&gt;com.foo.bar.helper.AuthenticationFilter&lt;/filter-class&gt;
          &lt;init-param&gt;
          &lt;param-name&gt;unprotectedUrls&lt;/param-name&gt;
          &lt;param-value&gt;/,/login,/authentication,/notification,/sdr&lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/filter&gt;
  </code></pre>
  
  <p>it is not recognized which means that I don't have to be logged in for all paths/URLs. No filtering takes place.</p>
  
  <p>My intention is to make the init-params configurable so that I don't have to edit the code/class whenever a further URL shall be included or so.</p>