title: spring injection in servlet filter
body: <p>I am trying to do spring injection to servlet filter.The filter is apart of the referenced jar files. so. I cannot change it as interceptor. In web.xml of my plugin project</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;filter&gt;
      &lt;filter-name&gt;CustomFilter&lt;/filter-name&gt;    
      &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;    
      &lt;init-param&gt;    
          &lt;param-name&gt;someinitparam&lt;/param-name&gt;    
          &lt;param-value&gt;value to it&lt;/param-value&gt;    
      &lt;/init-param&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;CustomFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/mywebservices/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  </code></pre>
  
  <p>In spring.xml I will use like this</p>
  
  <pre><code>&lt;bean id="CustomFilter" class="com.abc.CustomFilter"&gt;&lt;/bean&gt;
  </code></pre>
  
  <p>There are some filters are already configured in spring.xml as</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy"&gt;
      &lt;property name="filterInvocationDefinitionSource"&gt;
          &lt;value&gt;
              CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
              PATTERN_TYPE_APACHE_ANT
              /mywebservices/*=some existing filters
          &lt;/value&gt;              
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>As I have already specified my url pattern in web.xml do I need to add again in filterChainProxy as</p>
  
  <pre><code>/mywebservices/**=CustomFilter, some existing filters
  </code></pre>
  
  <p>Will it work.</p>
  
  <p>Please suggest.</p>