org.springframework.boot
spring-boot-starter-thymeleaf
或者在最初创建项目的时候,添加 Thymeleaf
2. 编写controller
@Controller
public class HelloController {
/**
-
查出数据并展示在页面
-
@return
*/
@RequestMapping(“/success”)
public String success(Map<String, Object> map) {
map.put(“name”, “
扬帆向海
”);map.put(“employees”, Arrays.asList(“程序员”, “架构师”, “项目经理”));
return “success”;
}
}
3. 编写 success.html
注意:suc