Search code examples
javaspringspring-bootthymeleaf

How to add parameter to this thymeleaf link, if I need to have an id parameter also?


I need id to be there and this parameter sortField=${sortField}. How can this be done?

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

Solution

  • You can just add it as an extra parameter (without a placeholder).

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

    See the last example here.