1. 咋Spring Boot,我们可以用一下方式处理静态资源
webjars 访问: localhost:8080/webjars/ (基本不用)
public、 static、 /**、 resources
访问:localhost:8080/webjars/
2. 优先级: resources> static:默认>public
二、thymeleafmaven依赖
org.thymeleaf thymeleaf-spring5org.thymeleaf.extras thymeleaf-extras-java8time
控制层、路径映射
@RequestMapping("/test")
public String hello(Model model){
model.addAttribute("msg","你好阿");
model.addAttribute("color","color:red");
model.addAttribute("users", Arrays.asList("张三","李四","王二狗"));
return "aaa";
}
html代码
th命名空间引用:xmlns:th="http://www.thymeleaf.org"
Title
首页
=======================================
哈哈哈
=======================================
=======================================
[[${user}]]
测试结果
三、themeleaf语法1. 赋值
model.addAttribute("msg","你好阿");
2. 样式
model.addAttribute("color","color:red");
哈哈哈
3. 遍历
model.addAttribute("msg","你好阿");
=======================================
[[${user}]]



