I have a filterclass that i normally will put in web.xml. may i know how to specify it inside spring applicationcontext so that i able to use spring features in my fitlerclass?
Best. Class. Ever.
Gandalf
2009-10-01 15:15:55
+2
A:
leonm's answer is 100% correct, but like many things in Spring there are multiple ways of doing this (well at least in Spring Security's case).
You can also subclass SpringSecurityFilter
and then add it to the Spring Security Filter Chain like this:
<bean id="mySecurityFilter" class="org.example.MySecurityFilter">
...setup like a normal bean
<custom-filter position="LAST"/>
</bean>
Check out this link <security:custom-filter>
for all the different values you can use for the position
argument.
Gandalf
2009-10-01 16:39:59
if my filterclass is nothing to do with spring security. i add up this way as well? let say i want to add custom ntlmhttpfilter class that i normally add in web.xml
cometta
2009-10-02 00:58:41
Probably not, but since I did not know what your filter was doing I figured I would show you the second option.
Gandalf
2009-10-02 02:54:34