天天看點

1.5.4. Request, Session, Application, and WebSocket Scopes Spring Framework Documentation (5.3.10)

 Spring Framework Documentation (5.3.10)

Core IoC Container, Events, Resources, i18n, Validation, Data Binding, Type Conversion, SpEL, AOP.

   Core Technologies

1. The IoC Container

1.1. Introduction to the Spring IoC Container and Beans(Spring IoC容器和bean簡介)

1.2. Container Overview (容器概覽)

1.3. Bean Overview (Bean概覽)

1.4. Dependencies(依賴)

1.5. Bean Scopes(Bean作用域)

1.5.1. The Singleton Scope (單例作用域)

1.5.2. The Prototype Scope(Prototype作用域)

1.5.3. Singleton Beans with Prototype-bean Dependencies(單例和原型Bean的依賴)

1.5.4. Request, Session, Application, and WebSocket Scopes

1.5.4.1. Initial Web Configuration (初始化Web配置)

1.5.4.2. Request scope(請求作用域)

1.5.4.3. Session Scope(會話作用域)

1.5.4.4. Application Scope(應用作用域)

1.5.4.5. Scoped Beans as Dependencies (具有作用域的bean作為依賴項)

1.5.4.5.1 Choosing the Type of Proxy to Create(選擇待建立代理的類型)

1.5.5. Custom Scopes (自定義作用域)

1.5.5.1. Creating a Custom Scope(建立自定義作用域)

1.5.5.2. Using a Custom Scope (使用自定義作用域)

更多章節内容,請點選檢視:  Core Technologies

1.5.4. Request, Session, Application, and WebSocket Scopes(Request, Session, Application, and WebSocket作用域)

The 

request

session

application

, and 

websocket

 scopes are available only if you use a web-aware Spring 

ApplicationContext

 implementation (such as 

XmlWebApplicationContext

). If you use these scopes with regular Spring IoC containers, such as the 

ClassPathXmlApplicationContext

, an 

IllegalStateException

 that complains about an unknown bean scope is thrown.

請求(

request

)、會話(

session

)、應用(

application

)和websocket作用域僅在使用web感覺的Spring ApplicationContext實作(如

XmlWebApplicationContext

)時可用。如果将這些作用域與正常Spring IoC容器(如

ClassPathXmlApplicationContext

)一起使用,則會抛出一個IllegalStateException,會抛出未知的bean作用域異常。

繼續閱讀