title: spring java based - adding of filter
body: <p>in xml in order to add a cors filter, we would do something like this in web.xml:</p>
  
  <pre><code>  &lt;filter&gt;
      &lt;filter-name&gt;cors&lt;/filter-name&gt;
      &lt;filter-class&gt;MyCorsFilter&lt;/filter-class&gt;
    &lt;/filter&gt;
    &lt;filter-mapping&gt;
      &lt;filter-name&gt;cors&lt;/filter-name&gt;
      &lt;url-pattern&gt;/secured/*&lt;/url-pattern&gt;
    &lt;/filter-mapping&gt;
  </code></pre>
  
  <p>But we're on java based configuration now, how can we implement this programmatically?</p>