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

 

posted @ 2014-10-16 15:38  指尖舞步  阅读(4535)  评论(0编辑  收藏  举报