bean的作用域:
spring bean的作用域默认是singleton;
bean的作用域为prototype时使用ClassPathXmlApplicationContext出事context时不会加载bean,只有getBean的时候才会加载对应的bean。
相当于bean的懒加载。
bean的作用域:
spring bean的作用域默认是singleton;
bean的作用域为prototype时使用ClassPathXmlApplicationContext出事context时不会加载bean,只有getBean的时候才会加载对应的bean。
相当于bean的懒加载。
转载于:https://my.oschina.net/zhangdq/blog/1606145