IDEA开发springboot项目遇到的问题:Cannot resolve MVC View 'XXX'


事情来源:我自己从头写springboot,到了控制类发现接不上静态资源!
找了很久,最后发现,只需要换依赖版本,让spring-boot-starter-thymeleaf和spring-boot-dependencies对应即可!

<properties>
    <spring-boot>2.6.1</spring-boot>
</properties>
<!--springboot使用spring data jpa 为止所添加的依赖-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-dependencies</artifactId>
    <version>${spring-boot}</version>
    <type>pom</type>
    <scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
    <version>${spring-boot}</version>
</dependency>

结果就可以了:


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM