GlobalSession 范围的 beans 是否从 spring 5 中删除了?为什么?

2024-02-29

1. Spring 5 中是否删除了全局会话范围的 beans?

官方文档不再提及。 SCOPE_GLOBAL_SESSION 不再是 RequestAttributes 的一部分:

春季 4:https://docs.spring.io/autorepo/docs/spring/4.2.4.RELEASE/javadoc-api/org/springframework/web/context/request/RequestAttributes.html#SCOPE_GLOBAL_SESSION https://docs.spring.io/autorepo/docs/spring/4.2.4.RELEASE/javadoc-api/org/springframework/web/context/request/RequestAttributes.html#SCOPE_GLOBAL_SESSION

春季 5:https://docs.spring.io/autorepo/docs/spring/current/javadoc-api/org/springframework/web/context/request/RequestAttributes.html#SCOPE_GLOBAL_SESSION https://docs.spring.io/autorepo/docs/spring/current/javadoc-api/org/springframework/web/context/request/RequestAttributes.html#SCOPE_GLOBAL_SESSION

2. 如果 1 为真:为什么它们被删除?

Update:

找到一个删除这些内容的提交。似乎是因为 Portlet 的丢失: 请参阅提交:https://github.com/spring-projects/spring-framework/commit/2b3445df8134e2b0c4e4a4c4136cbaf9d58b7fc4#diff-42e7410c98a33ab499e5c27858b1c985 https://github.com/spring-projects/spring-framework/commit/2b3445df8134e2b0c4e4a4c4136cbaf9d58b7fc4#diff-42e7410c98a33ab499e5c27858b1c985


是的。那SCOPE_GLOBAL_SESSION用于跨 Portlet 和 Servlet 共享会话。并且Portlet支持在Spring 5中被删除SPR-14129 https://github.com/spring-projects/spring-framework/issues/18701因为 :

Spring 的 Portlet MVC 支持变成了二等功能 近年来,从未更新到现代HandlerMethod目前 Servlet MVC 所基于的基础设施 (从 3.1 开始,旧的 Servlet MVC 变体已弃用 3.2)。此外,Portlet 3.0规范本身打算引入注释驱动的调度,因此没有战略地位 对于 Spring Portlet MVC 来说也是如此,即使是在其目前的利基范围内。最后 但并非最不重要的是,常见的 Portlet 环境似乎都停留在 Spring 上 3.x,甚至还没有升级到 Spring 4.x。

因此,从 Spring 5 开始,我们将完全放弃 Portlet MVC 支持, 同时介绍我们的 Reactive MVC 变体。我们打算 继续支持(但不推荐)将 Spring 与 JSF 结合使用 在 Portlet 环境中,特别是通过 Spring Web Flow。为了 所有其他目的,Spring Framework 4.3.x 将继续受支持,直到 2020 年,包括其 Portlet MVC 支持(以及底层 Servlet 2.5 支持)。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

GlobalSession 范围的 beans 是否从 spring 5 中删除了?为什么? 的相关文章

随机推荐