![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Thymeleaf
torpidcat
学习中...
展开
-
thymeleaf在js中取后台放在model中值
需要使用th:inline="javascript"显式开启,即必须在<script></scipt>标签上加上<script th:inline="javascript"> ... var data = [[${staffList}]];//获取后台model中的值 ...</script>后台java@GetM...原创 2020-03-15 17:13:16 · 700 阅读 · 0 评论 -
thymeleaf org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing
springboot项目,前端用的thymeleaf,对象列表页点击跳转到对象编辑页的时候报了一个错ERROR o.t.TemplateEngine - [process,1136] - [THYMELEAF][http-nio-9998-exec-3] Exception processing template "system/bmExpress/editGetExpress": An e...原创 2019-10-24 15:22:46 · 3131 阅读 · 0 评论 -
若依+Thymeleaf 格式化日期 使用 layui中laydate时间控件展示
文本控件用th:value="${#dates.format(testArticle.planEndDate,'yyyy-MM-dd HH:mm:ss')}" 方式格式化日期。这里的testArticle.planEndDate为表单object定义的对象testArticle属性,testArticle为后台传过来的对象<!DOCTYPE HTML>...原创 2019-09-10 17:43:39 · 9456 阅读 · 0 评论 -
若依+Thymeleaf 获取复选框参数和回显
参考:Thymeleaf获取复选框参数和回显https://blog.csdn.net/Qii_yuan/article/details/88651078方式一、HTML:遍历所有渠道,判断每个渠道是否存在已有渠道集合channelList中,存在,则设置当前渠道checked属性为true,否则为false<!-- 若依重新封装了复选框样式,所以这里在label上...原创 2019-08-28 15:44:56 · 6173 阅读 · 0 评论 -
thymeleaf each 循环onclick参数取值 使用[[]]传递参数
原代码中使用each遍历自定义的字典集合,在onclick参数中传递字典集合的值,代码中js获取不到onclick中参数值:<span th:each="dict:${@dict.getType('dict_level')}" th:text="|${dict.dictLabel}|" th:value ="${dict.dictValue}" th:onclick="selectL...转载 2019-05-13 15:39:55 · 5147 阅读 · 5 评论 -
Thymeleaf select 实现默认选中,使用 th:field 字符串无效问题
SpringBoot项目,前端使用Thymeleaf,要实现一个select下拉控件自动选中的功能。具体步骤是后端传递下拉列表需要加载的数据集合,以及当前需要被选中的值,前端select中使用Thymeleaf的th:field自动判断并选中下拉控件:错误代码(使用字符串传递值userId,这里前端判断无效): /** * 新增员工 */ @GetMapping("/ad...原创 2019-05-20 11:58:50 · 10673 阅读 · 2 评论 -
thymeleaf 多选按钮checkbox 的使用
后端java(springboot)查询结果集合 /** * 新增网点 */ @GetMapping("/add") public String add(ModelMap modelMap) { List<Brand> brands = brandService.selectAllBrand(); mode...原创 2019-04-26 17:24:26 · 9574 阅读 · 4 评论 -
thymeleaf th:value 多个值拼接 使用+号 或者|符号 (不适用于th:field)
注意,不能在th:field中使用拼接thymeleaf th:value 可以使用+号拼接两个字符串<div class="col-sm-9"> <label th:each="brand:${brands}" class="check-box"> <input id="brands" name="brands" type="checkb...转载 2019-04-26 17:17:03 · 15198 阅读 · 2 评论 -
thymeleaf th:text th:utext区别
<!DOCTYPE html><html lang="en"><html xmlns:th="http://www.thymeleaf.org"><head> <meta charset="UTF-8"> <title>详情页</title&am转载 2019-01-29 19:05:15 · 2870 阅读 · 0 评论 -
thymeleaf html 格式化时间 格式化日期
<!DOCTYPE html><html lang="en"><html xmlns:th="http://www.thymeleaf.org"><head> <meta charset="UTF-8"> <title>详情页</title&am原创 2019-01-29 19:02:26 · 4706 阅读 · 0 评论 -
SpringBoot+Thymeleaf模板 实现html文件引入
参考https://www.jianshu.com/p/acee38389266https://blog.csdn.net/h1021456873/article/details/79085505SpringBoot中使用Thymeleaf模板,需要在项目的application.properties文件中进行相关配置,如下:spring.thymeleaf.prefix=cla...原创 2019-01-11 11:55:28 · 4565 阅读 · 0 评论