有人可以解释一下Spring bean中的范围,我总是只使用'原型',但是我可以用其他参数代替吗?
我正在谈论的例子
<bean id="customerInfoController" class="com.action.Controller" scope="prototype">
<property name="accountDao" ref="accountDao"/>
<property name="utilityDao" ref="utilityDao"/>
<property name="account_usageDao" ref="account_usageDao"/>
</bean>
Run Code Online (Sandbox Code Playgroud) 1. Spring 5 中是否删除了全局会话范围的 beans?
官方文档不再提及。SCOPE_GLOBAL_SESSION 不再是 RequestAttributes 的一部分:
2. 如果 1 为真:为什么它们被删除?
更新:
找到一个删除这些内容的提交。似乎是因为Portlet的删除:参见提交:https ://github.com/spring-projects/spring-framework/commit/2b3445df8134e2b0c4e4a4c4136cbaf9d58b7fc4#diff-42e7410c98a33ab499e5c27858b1c985