Skip to content

Incorrect usage of application property in FreeMarkerTemplateAvailabilityProvider leads to issues with user supplied error views #4085

@tvirtualw

Description

@tvirtualw

org.springframework.boot.autoconfigure.freemarker.FreeMarkerTemplateAvailabilityProvider#isTemplateAvailable in 1.3.0.M5 uses

String loaderPath = environment.getProperty("spring.freemarker.path", FreeMarkerProperties.DEFAULT_TEMPLATE_LOADER_PATH);

Instead it should use spring.freemarker.template-loader-path as per the Spring Boot documentation.

When using a non-default location for Freemarker templates, it is not possible to simply add a custom error view to replace the whitelabel error page. Adding error.ftl to the template directory should suffice. However, due to the bug, it cannot be loaded because the system always looks in the default classpath:/templates/ location and does not find it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions