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
You can't make a Filter spring managed like this. With your setup it is instantiated once by spring, and once by the servlet container. Instead, use DelegatingFilterProxy:
<filter>
in web.xmlSet the targetBeanName
init-param of the filter definition to specify the bean that should actually handle the filtering:
<init-param>
<param-name>targetBeanName</param-name>
<param-value>creditFilter</param-value>
</init-param>