1,静态文件夹src/main/resources/static下的,图片必须放在images文件夹下才能访问,直接放在static下不能访问

2,配置热部署,否则修改下Html,图片都得重启

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

https://www.cnblogs.com/yangxiaomei/p/9608029.html

https://www.cnblogs.com/lspz/p/6832358.html

3,thymeleaf教程

https://www.jianshu.com/p/908b48b10702

th:text  改变元素的文本 转义特殊字符

th:utext 不转义特殊字符

th:html任意属性  改变元素的任意属性

th:fragment 声明片段

th:replace th:insert 片段包含 类似 jsp:include

th:each 类似 c:forEach

th:if 条件判断 类似c:if

th:object th:with 声明变量

th:attr 属性修改

表达式语法:${...} 获取变量值或调用方法,${person.name} ${person.method()}

${#内置基本对象,内置工具对象} #ctx;#vars,#local,#request,#respose #session,#servletContext

${session.foo},${#strings.startWith()}

*{...} :选择表达式,配合th:object使用

#{...}获取国际化内容

@{...}定义URL连接 

@{/order/details(id=${o.id})} 括号后面跟查询参数,前面自动拼接contextPath

<!-- Will produce 'http://localhost:8080/gtvg/order/details?orderId=3' (plus rewriting) -->
<a href="details.html"
th:href="@{http://localhost:8080/gtvg/order/details(orderId=${o.id})}">view</a>
<!-- Will produce '/gtvg/order/details?orderId=3' (plus rewriting) -->
<a href="details.html" th:href="@{/order/details(orderId=${o.id})}">view</a>
<!-- Will produce '/gtvg/order/3/details' (plus rewriting) -->
<a href="details.html" th:href="@{/order/{orderId}/details(orderId=${o.id})}">view

 

var num = [[${num}]]; 转义,双中括号 相当于th:text
var user = [(${user.toString()})]; 不转义 中括号,括号 相当于th:utext
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄