2020
10-10
10-10
Thymeleaf中th:each及th:if使用方法解析
一、th:each作用:用于遍历controller层发送过来的集合。例:Controller代码:@ControllerpublicclassHelloController{@RequestMapping("/success")publicStringsuccess(Map<String,Object>map){map.put("users",Arrays.asList("张三","李四","王五"));return"success";}}下面我们通过th:each属性在html页面将其遍历显示出来<!DOCTYPEhtml><htmllang="en"xmlns:th="http://www.thymeleaf.org"><head>...
继续阅读 >