SpringBoot集成Freemarker前端模板
1、在pom.xml中引入freemarker的jar包 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-freemarker</artifactId> </dependency> 2、在resources/application.yml配置文件中添加 freemarker的配置信息 spring: freemarker: allow-request-override: false cache: true charset: UTF-8 check-template-location: true content-type: text/html; suffix: .ftl template-loader-path: classpath:/templates/ 3、创建PageController并添加index方法 package com.jeff.controller; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.springframework.stereotype.Controller; import org