一、在pom.xml中添加如下代码
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
二、新建一个Controller
@Controller
public class SecondController {
@RequestMapping("/ftlIndex")
public String ftlIndex() {
return "ftlIndex";
}
}
三、在/src/main/resources/templates下找
新建文件 ftlIndex.ftl