SpringBoot整合FreeMarker

阅读量: 108 编辑

SpringBoot整合FreeMarker

1、pom.xml文件中添加依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>

2、application.yml 文件中添加配置

# FreeMarker
spring:
    freemarker:
        cache: false
        checkTemplateLocation: true
        contentType: text/html
        suffix: .html
        templateEncoding: UTF-8
        templateLoaderPath: classpath:templates