Springboot---显示图片/字符串/map集合/list集合
1.字符串/图片/map集合 @GetMapping("/hello") public String test(Model model){ String message="first thymeleaf !!"; model.addAttribute("message",message); User u = new User(); u.setId(1); u.setName("ttttttt"); u.setAge(18); Map<String,Object> map=new HashMap<>(); map.put("s1","/static/1.jpg"); map.put("s2","/static/2.jpg"); model.addAttribute("message", message); model.addAttribute("user", u); model.addAttribute("src", map); return "index2"; } index2.html<body> <h1 th:text="${message}"></h1> <img th:src="${src.s1}"/></br> <img th:src="${src.s2}"/></br> 实体类信息<br> <span th:text="${user.id}"></span> <span