SpringBoot整合FreeMarker

2023-04-27 15:44:35 浏览数 (2)

SpringBoot整合FreeMarker

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

代码语言:javascript复制
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>

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

代码语言:javascript复制
# FreeMarker
spring:
    freemarker:
        cache: false
        checkTemplateLocation: true
        contentType: text/html
        suffix: .html
        templateEncoding: UTF-8
        templateLoaderPath: classpath:templates

0 人点赞