6、spring component-scan扫描 context:exclude-filter 与 context:include-filter

1 在主容器中(applicationContext.xml),将Controller的注解打消掉

<context:component-scan base-package="exampleBean">  
        <context:exclude-filter type="annotation"  
            expression="org.springframework.stereotype.Controller" />  
    context:component-scan> 

2 在主容器中(applicationContext.xml),按正则过滤指定类

<context:component-scan base-package="exampleBean">  
  
    <context:exclude-filter type="regex"  
        expression="exampleBean\.Default*" />  
context:component-scan>  

3 在主容器中(applicationContext.xml),按指定类名过滤指定类

<context:component-scan base-package="exampleBean">  
  
    <context:exclude-filter type="assignable" expression="exampleBean.MovieFinder"/>  
context:component-scan>  

你可能感兴趣的:(jdk,/,线程池/,线程安全)