【问题标题】:How to add parameter to this thymeleaf link, if I need to have an id parameter also?如果我还需要一个 id 参数,如何向这个 thymeleaf 链接添加参数?
【发布时间】:2022-02-03 22:38:31
【问题描述】:

我需要 id 和这个参数 sortField=${sortField}。如何做到这一点?

 th:href="@{/admin/orders/decline/{id}(id=${order.id})}"

【问题讨论】:

    标签: java spring spring-boot thymeleaf


    【解决方案1】:

    您可以将其添加为额外参数(不带占位符)。

    th:href="@{/admin/orders/decline/{id}(id=${order.id},sortField=${sortField})}"
    

    见最后一个例子here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-16
      • 1970-01-01
      • 2018-04-15
      • 2021-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多