【问题标题】:Why I can't get my freemarker template page (Spring)?为什么我无法获得我的 freemarker 模板页面 (Spring)?
【发布时间】:2021-03-21 20:09:55
【问题描述】:

我得到 404 未找到。我做错了什么?

@GetMapping(PRIVACY_POLICY_ENDPOINT)
public String getPrivacyPolicyPage() {
    return "/privacyPolicy.ftlh";
}

路径:

src/main/resources/templates/privacyPolicy.ftlh

分级:

implementation "org.springframework.boot:spring-boot-starter-freemarker"
implementation "org.springframework.boot:spring-boot-starter-web"

我尝试设置属性,但没有帮助

  freemarker:
    enabled: true
    template-loader-path: classpath:/templates
    suffix: .ftlh

【问题讨论】:

    标签: java spring-boot spring-mvc freemarker


    【解决方案1】:

    通过从返回中删除 .ftlh 解决了问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-23
      • 2017-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多