在pom.xml中添加依赖:
<!--jstl表达式--> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> </dependency> <!--不加这个jar会报错--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-freemarker</artifactId> </dependency>
记得更新pom.xml
application.yml中添加
freemarker: template-loader-path: /WEB-INF/ suffix: .ftl