Create restful URL with th:href

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Create restful URL with th:href

tom123
I have the following link:

<a href="#" th:href="@{/card/edit/(id=${card.id})}" title="Edit">Edit</a>

Which generates: /card/edit/?id=1

How can I get it to generate the following?
/card/edit/1

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Create restful URL with th:href

Zemi
Administrator
You have -at least- two options.

Option 1:
    < a href="#" th:href="@{/card/edit/__${card.id}__}" title="Edit">Edit< /a>

Option 2:
    < a href="#" th:href="@{'/card/edit/' + ${card.id}}" title="Edit">Edit< /a>
Reply | Threaded
Open this post in threaded view
|

Re: Create restful URL with th:href

tom123
Cheers Zemi.
Reply | Threaded
Open this post in threaded view
|

Re: Create restful URL with th:href

Muhammed Riyas
In reply to this post by tom123
Thanks Dear