一.使用表達式形式:@{...}
例如:
<a th:href="@{http://localhost:8080/gtvg/order/details}">view</a>
帶參數的URL連接:
@{/order/process(execId=${execId},execType='FAST')}
相當於:/order/process?execId=${execId},execType='FAST'
拼接URL寫法:
<a th:href="@{'/details/'+${user.login}(orderId=${o.id})}">view</a>
href和th:href的區別:
<a href="/page/test1" th:href="@{/page/test2}">跳轉</a>
當兩者同時出現時,最終實現的效果是th:href的效果