访问index时报错:
org.thymeleaf.exceptions.TemplateInputException: Error resolving template "index", template might not exist or might not be accessible by any of the configured Template Resolvers
at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:246) ~[thymeleaf-2.1.6.RELEASE.jar:2.1.6.RELEASE]
pom.xml添加依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
意思是找不到index页面,index所在目录不对,改成正确的就行了

还不行的话改成templates

本文解决了一个关于Thymeleaf访问index页面时出现的模板输入异常问题,并提供了具体的解决方案,包括检查页面路径和添加依赖。
1874





