2013-06-21 17 views
0

我已经通过编程方式配置了AnnotationConfigWebApplicationContext以运行Web应用程序。但我想添加一些由注释提供的自定义逻辑。通过自定义注释进行扫描的编程等效物

,这是什么程序等效代码块:

<context:component-scan base-package="org.aaa"> 
    <context:include-filter type="annotation" expression="com.annotation.Fooish" /> 
</context:component-scan> 

感谢

回答

0

我已经改变了我的应用程序,而不是使用程序扫描注释。

@ComponentScan(
       basePackages = {"xxx", "yyy"}, 
       useDefaultFilters = true, 
       includeFilters = {@ComponentScan.Filter(value com.annotation.Fooish.class)} 
)