Spring Boot IoC(八)Bean的做用域

上一篇 Spring Boot IoC(七)条件装配Beanjava 8、Bean的做用域 IoC容器最顶级的接口BeanFactory中有两个方法isSingleton(单例)和isPrototype)(原型)web isSingeleton:返回true,Bean在Ioc容器中以单例存在(Spring默认) isPrototype:返回true,每次获取Bean,Ioc容器都会建立一个新的Be
相关文章
相关标签/搜索