【问题标题】:Thymeleaf get url attributeThymeleaf 获取 url 属性
【发布时间】:2017-04-12 06:19:33
【问题描述】:

我想提取 thymeleaf 模板中的 url 属性。我正在尝试这样:

发送此查询 http://somedomain/myPage?text=blah

myPage.html

<div th:text="${param.text}"></div>

Bu 而不是 blah 我得到[Ljava.lang.String;@797291bb

【问题讨论】:

    标签: java html spring url thymeleaf


    【解决方案1】:

    ${param.text} 解析为一个数组。要获取实际值,您必须使用${param.text[0]}

    【讨论】:

      猜你喜欢
      • 2013-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-03
      • 1970-01-01
      • 2011-09-17
      • 1970-01-01
      • 2017-10-04
      相关资源
      最近更新 更多