spring component-scan配置扫描多个包 spring的component-scan扫描多个包: <context:component-scan base-package="x.y.z.service, x.y.z.controller" /> 注意这里必须是包名。