SpringBoot中整合freemarker时配置文件application.properties示例代码

场景

整合过程参照:

https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/89074931

实现

如果要想配置freemarker的一些其他配置,在application.properties中添加

#springboot整合freemarker
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-spring-macro-helpers=false
#设置文件后缀
spring.freemarker.suffix=.ftl
#设置配置文件位置
spring.freemarker.template-loader-path=classpath:/templates

猜你喜欢

转载自blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/89075035