spring的component-scan扫描多个包:

<context:component-scan base-package="x.y.z.service, x.y.z.controller" />

注意这里必须是包名。

相关文章: