【问题标题】:Can Thymeleaf access to Ktor session attributes?Thymeleaf 可以访问 Ktor 会话属性吗?
【发布时间】:2020-12-04 18:35:21
【问题描述】:

在使用 KtorThymeleaf 的应用程序中,我无法使用 ${session} 访问会话属性。 Thymeleaf documentation.

是否可以从 Thymeleaf 模板访问 Ktor 会话属性?

【问题讨论】:

    标签: thymeleaf ktor


    【解决方案1】:

    在底层,Ktor 使用 Thymeleaf 的 IContext 的基本非 Web 实现,因此您无法在模板中获取会话属性,除非将它们作为变量显式传递。

    我在 Ktor 问题跟踪器中创建了一个feature request 来解决这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-05
      • 1970-01-01
      • 2013-06-22
      • 2012-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多