There are 2 entries for a Servlet Filter, one in web.xml and one in Spring applicationContext.xml
I added the filter into applicationContext.xml because I wanted to inject creditProcessor bean into it.
The only problem is that the entry in web.xml got picked up by JBoss and then used, so creditProcessor is null.
Do I have to use Spring's delegatingFilterProxy or similar so I can inject stuffs into the bean, or can I tweak the web.xml?
web.xml
<filter>
<filter-name>CreditFilter</filter-name>
<filter-class>credit.filter.CreditFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CreditFilter</filter-name>
<url-pattern>/coverage/*</url-pattern>
</filter-mapping>
Spring-applicationContext.xml
<bean id="creditFilter" class="credit.filter.CreditFilter" >
<property name="creditProcessor" ref="creditProcessor"/>
</bean>