2013-01-25 60 views
0

我需要将这些目录添加到我的应用程序。这实际上工作:弹簧组件扫描多个目录

<context:component-scan base-package="web.controllers"/> 
<context:component-scan base-package="web.controllers.gec"/> 
<context:component-scan base-package="web.controllers.gec.costs"/> 
<context:component-scan base-package="web.controllers.gec.pay"/> 

布我想知道我怎么能只用一行代码。例如:

<context:component-scan base-package="web.controllers"> 
     <context:include-filter type="regex" expression=".*.*"/> 
</context:component-scan> 

任何帮助或想法?非常感谢!

回答

0

对不起,但实际上我以前张贴的解决方案,工作正常:

<context:component-scan base-package="web.controllers"> 
    <context:include-filter type="regex" expression=".*.*"/> 
</context:component-scan> 
1
<!-- The controllers are autodetected POJOs labeled with the @Controller annotation. --> 
<context:component-scan base-package="com.company.app" use-default-filters="false"> 
    <context:include-filter expression="org.springframework.stereotype.Controller" type="annotation"/> 
</context:component-scan> 
+0

这似乎也没关系!非常感谢! – elcadro