【发布时间】:2011-04-12 05:54:32
【问题描述】:
我有几项服务:
- example.MailService
- example.LDAPService
- example.SQLService
- example.WebService
- example.ExcelService
使用@Service 注释进行注释。如何排除除一项之外的所有服务?
例如,我只想使用 MailService。我使用以下配置:
<context:component-scan base-package="example">
<context:include-filter type="aspectj" expression="example..MailService*" />
<context:exclude-filter type="aspectj" expression="example..*Service*" />
</context:component-scan>
但现在所有服务都被排除在外了。
如果存在一个包含 MailService 的规则,为什么会排除所有服务?
【问题讨论】:
标签: spring configuration