声明:使用JDK8 ,spring5.0进行测试;
scope:指定对象的作用范围。
singleton :默认值,单例的.
prototype :多例的.
创建实例bean,装配到spring中,分别使用singleton 和prototype 进行测试;
装配如下,首先测多例;
<!-- 装配scopebean 单例的默认 prototype 是多例的 -->
<bean id="scopeBean"
声明:使用JDK8 ,spring5.0进行测试;
scope:指定对象的作用范围。
singleton :默认值,单例的.
prototype :多例的.
创建实例bean,装配到spring中,分别使用singleton 和prototype 进行测试;
装配如下,首先测多例;
<!-- 装配scopebean 单例的默认 prototype 是多例的 -->
<bean id="scopeBean"