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>