2014-12-05 32 views
1

我想用百里香創建REST網址。我一直是這樣的:thymeleaf使用動態參數/元素生成REST網址

<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

我怎樣才能實現這一目標?請幫忙。

回答

3

你需要什麼叫Preprocessing,只需按照鏈接!

在你的情況,你應該這樣做是這樣的:

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

它的工作原理。謝謝 – masterdany88 2014-12-07 13:16:53