1. 程式人生 > >SpringBoot(二)-- 整合FreeMarker模板

SpringBoot(二)-- 整合FreeMarker模板

pro span req -- oot -a log enc sta

1.pom依賴

    <!-- 引入freeMarker的依賴包. -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-freemarker</artifactId>
    </dependency>    

2.配置application.properties

  spring.freemarker.allow-request-override=false

  spring.freemarker.cache=true
  spring.freemarker.check-template-location=true
  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

SpringBoot(二)-- 整合FreeMarker模板