【问题标题】:Were GlobalSession scoped beans removed from spring 5? Why?是否从 Spring 5 中删除了 GlobalSession 范围的 bean?为什么?
【发布时间】:2019-07-11 12:50:09
【问题描述】:

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

官方文档不再提及。 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

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

2。如果 1 为真:为什么要删除它们?


更新:

找到了一个删除这些东西的提交。似乎是因为 Portlet 的丢弃: 见提交:https://github.com/spring-projects/spring-framework/commit/2b3445df8134e2b0c4e4a4c4136cbaf9d58b7fc4#diff-42e7410c98a33ab499e5c27858b1c985

【问题讨论】:

    标签: java spring spring-boot


    【解决方案1】:

    是的。 SCOPE_GLOBAL_SESSION 用于在 Portlet 和 Servlet 之间共享会话。并且支持的 Portlet 在 Spring 5 中在 SPR-14129 中被删除,因为:

    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 支持)。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-29
    • 2013-03-02
    • 2013-07-10
    • 1970-01-01
    • 2015-06-07
    • 2012-03-04
    相关资源
    最近更新 更多