1 th:each @Controller public class DemoController { @RequestMapping("/showInfo3") public String showInfo3(Model model) { List<User> list = new ArrayList<>(); list.add(new User(1, "zhangsan", 20)); list.add(new User(2, "lisi", 22)); list.add(new User(3, "wangwu发", 25)); // 需要一个Model对象 model.addAttribute("list", list); return "index3"; } } public class User { private Integer userId; private String username; private Integer userAge; public User() { super(); } public User(Integer userId, String username, Integer userAge) { super(); this.userId = userId; this.username = username; this.userAge = userAge; } public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } public String getUse