2013-01-25 61 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