spring boot configuration with integrated freemarker

pom.xml文件里引入jar包是必须的:
      <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-freemarker</artifactId>
        </dependency>

Next is freemarker of some configuration files in application.yml:

  freemarker:
    request-context-attribute: rc
    allow-request-override: false
    cache: true
    enabled: true
    check-template-location: true
    charset: UTF-8
    content-type: text/html
    expose-request-attributes: true
    expose-session-attributes: true
    expose-spring-macro-helpers: false
    template-loader-path: classpath:/templates/   
    suffix: .ftl
    settings:
      classic_compatible: true
      template_exception_handler: ignore
      number_format: #
      prefer-file-system-access: false

In which the configuration of static resources online to find a way to integrate general is to configure the following:

#    templateLoaderPath: classpath:/templates/
#    static-locations: classpath:/templates/
#    template-loader-path: classpath:/templates/

But do not take effect, take effect only after the configuration template-loader-path

Published 46 original articles · won praise 13 · views 60000 +

Guess you like

Origin blog.csdn.net/luliuliu1234/article/details/80851259