需要在Thymeleaf模板中循环迭代Hashmap变量中每一个的key和value 使用可以实现 示例如下: <tr th:each="instance : ${someHashMap}"> <td th:text="${instance.key}">key</td> <td th:text="${instance.value}">value</td> </tr> 其中,instance 代表这个hashmap的每一个key和value,里面…

2022-11-15 0条评论 305点热度 0人点赞 admin 阅读全文

现在Java下的时间日期有Date、LocalDateTime、LocalDate、Instant等多种,在thymeleaf中格式化成我们能看懂的日期,都是可以的。 例如有以下几种(Java代码): ontext context = new Context(); context.setVariable("standardDate", new Date()); context.setVariable("localDateTime", LocalDateTime.now()); context.setVariable…

2022-09-12 0条评论 498点热度 0人点赞 admin 阅读全文