![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
thymelea
文章平均质量分 79
Mai JH
这个作者很懒,什么都没留下…
展开
-
码匠社区笔记
Thymeleaf 知识点 静态资源 在IDEA中将css.js放在resource/static下,直接拖到html中即可完成快速添加 样式不显式:因为是采用相对路径来引用资源的 如:在/publish.html的l引用资源路径是("/")根,没问题 但当是二级路径/publish/index.html.此时的引用路径依旧是("/")根,但是需要的是"/publish/" 解决:动态引用 th:href="@{/css/oostatrap.css}" 兼顾查看静态页面无样式:< link th:h原创 2020-07-23 10:51:50 · 316 阅读 · 0 评论 -
必看Thymeleaf知识点
变量表达式 ${} 获取对象属性 th:value="${user.id}" 选择变量表达式 *{} 先使用 ${} 获取对象 th:object="${user}" 在使用 获取对象的属性 th:value="*{id}" 省略user 链接表达式 @{} 通过链接表达式@{}直接拿到应用路径,然后拼接静态资源路径 <script th:src="@{/webjars/jquery/jquery.js}"></script> <link th:href="@{/w原创 2020-07-06 19:38:57 · 239 阅读 · 0 评论