Bean的作用域 在bean标签后面可以加上scope singleton单例模式(默认) 单例模式下的所有对象指向的都是一个对象 <bean id="xx" class="xxxr" scope="singleton"/> prototype原型模式 每次从容器中getbean都是产生了一个新对象 <bean id="xx" class="xxxr" scope="prototype"/> request session application websocket 3、4、5、6只在web开发中使用 分享 赏
Comments | NOTHING