thymeleaf——th:each(th:each=“user:${users}不显示内容)

th:each="user:${users}不显示内容

检查:

.html文件中的users是否和Controller文件对应(users)

<h4 th:text="${user}" th:each="user,userStat:${users}"></h4>
    @RequestMapping("/success")
    public String success(Map<String,Object> map){
        map.put("users", Arrays.asList("zhangsan","lisi","wangwu"));
        return "success";
    }

thymeleaf——th:each(th:each=“user:${users}不显示内容)

上一篇:Svelte 中的列表渲染用法


下一篇:64 C++ 遍历算法 for_each