您的当前位置:首页正文

Spring 常用配置:Bean的Scope

来源:华拓网
项目结构图 pom.xml DemoSingletonService.class DemoProtoTypeService.class ScopeConfig.class Main.class

这个工程有一点小插曲,idea刚开始学使用,创建新java类没有包名,后来在Main下面新建了一个package,写上了包名,然后ScopeConfig中的@ComponentScan 才得以实现扫描整个包。