首页 > 代码库 > SpringBoot + Freemaker

SpringBoot + Freemaker

1)导入依赖包:
  1. <!-- Freemaker依赖包 -->
  2. <dependency>
  3. <groupId>org.springframework.boot</groupId>
  4. <artifactId>spring-boot-starter-freemarker</artifactId>
  5. </dependency>
2)配置文件:
  1. spring.freemarker.allow-request-override=false
  2. spring.freemarker.cache=true
  3. spring.freemarker.check-template-location=true
  4. spring.freemarker.charset=UTF-8
  5. spring.freemarker.content-type=text/html
  6. spring.freemarker.expose-request-attributes=false
  7. spring.freemarker.expose-session-attributes=false
  8. spring.freemarker.expose-spring-macro-helpers=false
  9. #spring.freemarker.prefix=
  10. #spring.freemarker.request-context-attribute=
  11. #spring.freemarker.settings.*=
  12. #spring.freemarker.suffix=.ftl
  13. #spring.freemarker.template-loader-path=classpath:/templates/#comma-separatedlist
  14. #spring.freemarker.view-names= #whitelistofviewnamesthatcanberesolved

SpringBoot + Freemaker