getWebSecurityConfigurers

getWebSecurityConfigurers

我正在研究Spring Security的内部结构,并且在WebSecurityConfiguration中发现了以下两种方法:

    public void setFilterChainProxySecurityConfigurer(
        ObjectPostProcessor<Object> objectPostProcessor,
        @Value("#{@autowiredWebSecurityConfigurersIgnoreParents.getWebSecurityConfigurers()}") List<SecurityConfigurer<Filter, WebSecurity>> webSecurityConfigurers)
        throws Exception {
          ...
        }




    @Bean
public AutowiredWebSecurityConfigurersIgnoreParents autowiredWebSecurityConfigurersIgnoreParents(
        ConfigurableListableBeanFactory beanFactory) {
          ...
        }


据我了解{@autowiredWebSecurityConfigurersIgnoreParents.getWebSecurityConfigurers()},在第一种方法中,调用方法autowiredWebSecurityConfigurersIgnoreParents。但是该方法具有参数ConfigurableListableBeanFactory beanFactory。如何传递此参数?

最佳答案

您误解了EL-expression,它实际上是从bean getWebSecurityConfigurers调用autowiredWebSecurityConfigurersIgnoreParents的。

方法AutowiredWebSecurityConfigurersIgnoreParents autowiredWebSecurityConfigurersIgnoreParents(ConfigurableListableBeanFactory beanFactory)是创建bean autowiredWebSecurityConfigurersIgnoreParents的方法。

08-28 22:59