1. Introduction of Freemarker package in Pom.xml
<dependency>        <groupId>org.springframework.boot</groupId>        <artifactId> Spring-boot-starter-freemarker</artifactid></dependency>
2. Add the Freemarker property configuration to the Springboot property profile (application.properties)
 spring.freemarker.allow-request-override=false   Spring.freemarker.cache  =true   Spring.freemarker.check -template-location=true   Span style= "COLOR: #000000" > #spring. Freemarker.charset  =utf-8 Spring.freemarker.content -type=text/html spring.freemarker.expose -  Request-attributes=false   Spring.freemarker.expose -session-attributes=false   Spring.freemarker.expose -spring-macro-helpers= false    Spring.freemarker.prefix  = Spring.freemarker.suffix  =.FTL 
PS: Here is a question, spring.freemarker.charset=utf-8 I this opportunity error, still do not know why.
3. Writing control classes
 PackageCom.test.springboot.control;ImportJava.util.Map;ImportOrg.springframework.stereotype.Controller;Importorg.springframework.web.bind.annotation.RequestMapping;ImportOrg.springframework.web.servlet.ModelAndView; @Controller Public classFreemarkercontrol {@RequestMapping (value= "/hellofreemarker")//direct access to the path without adding the project name     PublicModelandview Sayfreemarkerhello (map<string,object>map) {Modelandview mv=NewModelandview ("Hello");//instantiate a template viewMap.put ("msg", "Hello Freemarker XXX");//assigning values to parameters        returnmv//return template View Object    }}
PS: @RequestMapping (value= "/hellofreemarker") can also be written in @requestmapping ("/hellofreemarker") This way
4. Writing the FTL page
<! DOCTYPE html>
5. Start the Springboot startup file and start the file as follows
 Package Com.test.springboot; Import org.springframework.boot.SpringApplication; Import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication  Public class springbootapplication {    publicstaticvoid  main (string[] args) {        Springapplication.run (springbootapplication. class , args);}    }
6. After successful startup, the Access path
Http://localhost:8088/hellofreemarker
Here the basic configuration is successful.
Encountered a problem: when the directory structure as shown in the left image, that is, the white package icon style, referring to the 44859223 method of normal display as follows right
But can not access, always 404 error as shown, have not found the reason for subsequent updates!!
Springboot Integrated Freemarker