Fork me on github

spring boot thymeleaf 不能访问templates目录下的页面问题

springboot默认情况下可以直接访问四个目录下的静态文件(https://www.cnblogs.com/realzhaijiayu/p/16566667.html)
public
static
resources
META-INF/resources

引入 thymeleaf 之后才能访问 templates 目录下的静态页面,不能访问的原因是引入的 thymeleaf 的依赖有问题

<dependency>                                             <!--3-->
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
    <version>2.7.2</version>
</dependency>
posted @ 2022-08-19 18:53  zjy4fun  阅读(483)  评论(0编辑  收藏  举报