关于 Springboot 访问 html 404
文章目录
Springboot 项目中,当我们在 resources 目录下创建了一个 index.html 的页面

出现了 404 错误
需要注意两处:
pom.xml 文件中导入模板依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
index.html 放入到resources/templates 或者 resources/static 目录下
访问 localhost:8080 即可

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论