thymeleaf th:href 動態url

使用 <a th:href="@{/product/show(skuid=${product.id})}" target="_blank">產品</a>
可以得到 <a th:href="/product/show?skuid=12" target="_blank">產品</a>
若有多個參數 在()裏用 , 分開即可 如(skuid=${product.id},xx=${})
使用 <a th:href="@{'/product/show/'+${product.id}}" target="_blank">產品</a>
可以得到 <a th:href="/product/show/12" target="_blank">產品</a>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章