We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f41af7c commit 2aea087Copy full SHA for 2aea087
src/main/java/org/spring/examples/scope/README.md
@@ -2,8 +2,8 @@
2
3
## 注意事项
4
- 使用**@Scope("request")**来定义request Bean;
5
-- 当**Controller**中使用了request Bean时,**Controller**也应该使用**@Scope("request")**来标注该Controller是request作用域,这样Spring会为每个请求创建一个**User**实例;
6
-- 如果**Controller**未使用**@Scope("request")**标注,每次请求时Spring将只创建一个**User**实例,然后使用Proxy方式注入HttpServletRequest对象;
+- 当**Controller**中使用了request Bean时,**Controller**也应该使用**@Scope("request")**来标注该Controller,这样Spring会为每个请求创建一个**User**实例;
+- 如果**Controller**未使用**@Scope("request")**标注,每次请求时Spring将共享一个**User**实例,然后使用Proxy方式注入HttpServletRequest对象,如果是这样的话**User**不是线程安全的;
7
- 使用request Bean必须在web.xml根据需要定义**RequestContextListener/RequestContextFilter**
8
```xml
9
<listener>
0 commit comments