上QQ阅读APP看书,第一时间看更新
The DelegatingFilterProxy class
The o.s.web.filter.DelegatingFilterProxy class is a Servlet Filter provided by Spring Web that will delegate all work to a Spring bean from the ApplicationContext root, which must implement javax.servlet.Filter. Since by default the bean is looked up by name, using the <filter-name> value, we must ensure we use springSecurityFilterChain as the value of <filter-name>. The pseudocode for how o.s.web.filter.DelegatingFilterProxy works for our web.xml file can be found in the following code snippet:
public class DelegatingFilterProxy implements Filter {
void doFilter(request, response, filterChain) {
Filter delegate = applicationContet.getBean("springSecurityFilterChain")
delegate.doFilter(request,response,filterChain);
}
}