1.在springboot,我们可以使用以下方式处理静态资源
* webjars localhost:8080/webjars/WEB-INf/
* resources下的资源包:public,static,/**,resources localhost:8080/
2.resources下包的优先级:resources>static(默认包)>public
3.thymeleaf依赖:
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
</dependency>
只要需要使用Thymeleaf,只需要导入对应的依赖就可以了,我们将html页面放在我们的templeate包下,然后再controller层下相应跳转即可
@Controller
public class indexController {
@RequestMapping("/test")
public String test(){
return "test";
}
}