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

  例如:

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

 

相关文章:

  • 2022-12-23
  • 2020-04-17
  • 2021-11-15
  • 2021-11-25
  • 2021-09-27
  • 2021-06-23
  • 2022-12-23
  • 2021-11-12
猜你喜欢
  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
相关资源
相似解决方案