首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >5.Url表达式-thymeleaf

5.Url表达式-thymeleaf

作者头像
Yuyy
发布于 2022-06-28 19:43:18
发布于 2022-06-28 19:43:18
3790
举报

本文最后更新于 909 天前,其中的信息可能已经有所发展或是发生改变。

th:href

代码语言:javascript
复制
<a th:href="@{http://www.baidu.com}">绝对路径</a><br/>
<a th:href="@{/show5}">相对路径,相对于当前项目的根,相对于项目的上下文的相对路径</a><br/>
<a th:href="@{~/project2/resourcename}">相对于服务器的根</a><br/>
<a th:href="@{/show5(id=1,name=zhagnsan)}">相对路径-传参</a><br/>
<a th:href="@{/restful/54212}"> 相 对 路 径 - 传 参-restful</a><br/>

restful-controller

代码语言:javascript
复制
@RequestMapping("restful/{id}")
@ResponseBody
public String showInfo6(@PathVariable Integer id){
    System.out.println("restful id:"+id);
    return "id:"+id;
}

Post Views: 2,549

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020-1-01 1,如有侵权请联系 cloudcommunity@tencent.com 删除
目录
  • th:href
  • restful-controller
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档