无法解析是因为找不到拼接的前后缀,所以无法跳转。忘记导入模板引擎依赖
在pom.xml添加这个依赖
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
</dependency>