读书人

spring security的springSecurityFilt

发布时间: 2012-11-05 09:35:12 作者: rapoo

spring security的springSecurityFilterChain怎么初始化的

了解springSecurityFilterChain怎么初始化之前有必要先了解下 spring 的namespacehandler

http://static.springsource.org/spring/docs/2.0.x/reference/extensible-xml.html



        //此方法在父类GenericFilterBean的init方法中调用的        @Overrideprotected void initFilterBean() throws ServletException {synchronized (this.delegateMonitor) {if (this.delegate == null) {// If no target bean name specified, use filter name.if (this.targetBeanName == null) {                  //如果我们没有指定targetBeanName 将默认取filter的名字 即springSecurityFilterChainthis.targetBeanName = getFilterName();}// Fetch Spring root application context and initialize the delegate early,// if possible. If the root application context will be started after this// filter proxy, we'll have to resort to lazy initialization.WebApplicationContext wac = findWebApplicationContext();if (wac != null) {this.delegate = initDelegate(wac);}}}}

那么springSecurityFilterChain这个bean在哪里定义的呢

spring 的namespacehander在解析http://www.springframework.org/schema/security 命名空间的http元素时创建此bean的

参考:

Spring Security3源码分析-http标签解析

读书人网 >网络基础

热点推荐