错误信息:Error resolving template “login.html”
1、查找了login.html文件是存在的,首先要确定项目是否编译出target文件及静态资源和视图文件
2、检查配置文件,没有问题
3、maven依赖没有问题:
<project 。。。。。。。。。。。。。>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>3.0.9.RELEASE</version>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring4</artifactId>
<version>3.0.9.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
</plugin>
</plugins>
<!-- 编译xml -->
<!-- 编译配置文件 -->
<resources>
<resource>
<directory>src/main</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>
</project>
4、检查视图跳转WebMvcConfigurer
因为其他项目都是这样配置的,所以没太在意这部分,多次检查才发现是路径有误:
改为:
重启访问成功