Posts Springboot Thymeleaf Link URLs
Post
Cancel

Springboot Thymeleaf Link URLs

타임리프 URL 링크 걸기

th:href 속성으로 링크를 작성한다.

1
2
3
4
5
6
7
<!-- Will produce 'http://localhost:8080/gtvg/order/details?orderId=3' (plus rewriting) -->
<a href="details.html"
th:href="@{http://localhost:8080/gtvg/order/details(orderId=${o.id})}">view</a>
<!-- Will produce '/gtvg/order/details?orderId=3' (plus rewriting) -->
<a href="details.html" th:href="@{/order/details(orderId=${o.id})}">view</a>
<!-- Will produce '/gtvg/order/3/details' (plus rewriting) -->
<a href="details.html" th:href="@{/order/{orderId}/details(orderId=${o.id})}">view</a>

타임리프 사이트: Standard URL Syntax

This post is licensed under CC BY 4.0 by the author.

Extending Thymeleaf dialect : processing attribute value

Sprint boot + Mybatis + H2 + Thymeleaf + W3.css