- 没有指定的文件
- 文件名拼写错误
- 类注解不要写@RequestController(不解析视图),要用@Controller
- 加了后缀(.html/.jsp)
- 没有导入模板依赖,不要以为不用模板就不要依赖了,MVC视图解析就需要模板进行拼接,这个是相关的模板依赖,应该只需要导入最后一个就可以了
<dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf-spring5</artifactId> </dependency> <dependency> <groupId>org.thymeleaf.extras</groupId> <artifactId>thymeleaf-extras-java8time</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>
SpringnMVC视图解析失败
最新推荐文章于 2024-08-15 14:47:41 发布
关键词由CSDN通过智能技术生成