首页 > 其他分享 >Error resolving template [index], template might not exist or might not be accessible by any of the

Error resolving template [index], template might not exist or might not be accessible by any of the

时间:2023-01-10 23:56:47浏览次数:36  
标签:accessible templates might thymeleaf template true

1.thymeleaf依赖

    <!-- thymeleaf       -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>

2.注意静态资源的加载(templates)

      <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.properties</include>
                    <include>**/*.yml</include>
                    <include>**/*</include>
                </includes>
                <filtering>true</filtering>
            </resource>

3.配置

thymeleaf:
    cache: false
    prefix: classpath:/templates   1.本是默认的地址一般不要加 第一次问题去掉就成功了     2.如果需要加 最后面不要加/
    suffix: .html
    check-template-location: true
    check-template: true

 

标签:accessible,templates,might,thymeleaf,template,true
From: https://www.cnblogs.com/kidzxy/p/17041709.html

相关文章