为什么我不能得到我的freemarker模板页面(spring)?

xtupzzrd  于 2021-06-30  发布在  Java
关注(0)|答案(1)|浏览(288)

我找不到404。我做错了什么?

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

路径:

src/main/resources/templates/privacyPolicy.ftlh

grad尔:

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
bpzcxfmw

bpzcxfmw1#

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

相关问题