【问题标题】:thymeleaf generate REST url with dynamic parameters/elementsthymeleaf 生成带有动态参数/元素的 REST url
【发布时间】:2014-12-05 20:26:37
【问题描述】:

我想用 thymeleaf 创建 REST url。我有这样的事情:

<a th:href="@{customer/(${c.id})/edit}">Edit</a>

输出是: http://localhost:8080/app/customer/($%7Bs.id%7D)/edit

但我想得到:http://localhost:8080/app/customer/4/edit

我怎样才能做到这一点?请帮忙。

【问题讨论】:

    标签: spring rest url thymeleaf


    【解决方案1】:

    你需要什么叫Preprocessing,点击链接!

    在你的情况下,你应该这样做:

    <a th:href="@{customer/__${c.id}__/edit}">Edit</a>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-08-02
      • 2013-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多