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