thymeleaf了,踩了个坑,记录一下
th:href基本写法与th:src一样 ,一般写法th:href="@{值}"
例:th:href="@{/get/UserList}"
需要从model取值的写法:th:href="@{${model中的name值}}"
例:th:href="@{${dir}}"
需字符串与model中的值拼接写法:th:href="@{'字符串'+${model中的值}}"
例:th:href="@{'/page/'+${id}}"
href始终从端口开始作为根路径:如-http://localhost:8080/aa/bb
th:href会寻找项目路径作为根路径:如-http://localhost:8080/myProject/aa/bb
th:href带参数的写法,下面分别是带一个参数和两个参数的写法