1、pom.xml添加依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
2、配置freemarker的javaConfig
package com.im.adplayer.config;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import freemarker.template.TemplateException;
@Configuration
public class FreemarkerConfig {
@Autowired
protected freemarker.template.Configuration configuration;
@Autowired
protected org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver resolver;
@Autowired
protected org.springframework.web.servlet.view.InternalResourc