简体   繁体   中英

Why I can't get my freemarker template page (Spring)?

I get 404 not found. What do I do wrong?

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

Path:

src/main/resources/templates/privacyPolicy.ftlh

Gradle:

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

I tried to set properties, but it didn't help

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

Problem was solved by deleting.ftlh from return

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM