There was an unexpected error (type=Internal Server Error, status=500). Circular view path [/login]:

SpringBoot引入静态资源时出现的错误

解决方法

一、引入使用thymeleaf模板引擎

<!--支持跳转,springboot推荐使用thymeleaf模板引擎-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>

二、在resource目录下创建templates目录

三、在springBoot配置文件yml中添加相应配置

spring:
  thymeleaf:
    prefix: classpath:/templates/
发布了129 篇原创文章 · 获赞 9 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_41808387/article/details/104614311