thymeleaf的url屬性


一.使用表達式形式:@{...}

  例如:

<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的效果

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM