1、配置freemrker静态资源,所有模板、页面文件都存放在resources下的templates下
2、freemarker模板是以.ftl为后缀结尾的文件,模板文件
3、调用模板文件
在启动程序时,如果在页面出现的是字符串而非渲染的页面,回到pom.xml文件查看是否添加了freemarker
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
<version>RELEASE</version>
</dependency>
启动项目
渲染成功