<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.33</version>
</dependency>
package abc;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import java.io.IOException;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
public class TestFreemarker {
private static final Configuration configuration;
static {
configuration = new Configuration(Configuration.VERSION_2_3_21);
configuration.setDefaultEncoding("UTF-8");
configuration.setClassForTemplateLoading(TestFreemarker.class, "/template");
}
public static String process(Map<String, Object> objectMap, String templateName) throws IOException, TemplateException {
Template templa