Ana*_*man 7 java spring spring-annotations spring-boot component-scan
我使用spring组件扫描来自动检测bean:
@ComponentScan({"com.org.x, com.org.y"})
Run Code Online (Sandbox Code Playgroud)
问题是我想要com.org.x扫描所有类,但我想要一个单独的类com.org.y.SomeService.class,单独扫描com.org.y
我怎样才能做到这一点?
除了使用上下文扫描之外,我如何创建这个bean并注入应用程序上下文?
| 归档时间: |
|
| 查看次数: |
5784 次 |
| 最近记录: |