Spring ----Bean 的作用域

Scope 作用域:<bean id="hello"  class="com.xx.Hello" scope=" singleton"> </bean>

1.单例(默认)singleton   创建后 只存在一个类实例

2.原型  prototype  创建后 存在多个类实例

3.请求  request

4.会话 session

5.应用程序 application

6.套接字websocket

猜你喜欢

转载自www.cnblogs.com/chencn/p/12331158.html