What's the point of Spring MVC's DelegatingFilterProxy?

后端 未结 7 1969
长发绾君心
长发绾君心 2020-12-07 06:56

I see this in my Spring MVC app\'s web.xml:


    springSecurityFilterCh         


        
7条回答
  •  悲哀的现实
    2020-12-07 07:46

    The thing is, servlet filters are managed by the servlet container, and not by spring. And you may need to inject some spring components into your filters.

    So, if you need something like:

    public class FooFilter {
    
        @Inject
        private FooService service;
    
        public void doFilter(....) { .. }
    
    }
    

    then you need the delegating filter proxy.

提交回复
热议问题