Example usage for org.springframework.web.servlet.view.freemarker FreeMarkerConfigurer setDefaultEncoding

List of usage examples for org.springframework.web.servlet.view.freemarker FreeMarkerConfigurer setDefaultEncoding

Introduction

In this page you can find the example usage for org.springframework.web.servlet.view.freemarker FreeMarkerConfigurer setDefaultEncoding.

Prototype

public void setDefaultEncoding(String defaultEncoding) 

Source Link

Document

Set the default encoding for the FreeMarker configuration.

Usage

From source file:org.springframework.cloud.netflix.hystrix.dashboard.HystrixDashboardConfiguration.java

/**
 * Overrides Spring Boot's {@link FreeMarkerAutoConfiguration} to prefer using a
 * {@link SpringTemplateLoader} instead of the file system. This corrects an issue
 * where Spring Boot may use an empty 'templates' file resource to resolve templates
 * instead of the packaged Hystrix classpath templates.
 * @return FreeMarker configuration// ww w  .  j  a v  a2  s .  co m
 */
@Bean
public FreeMarkerConfigurer freeMarkerConfigurer() {
    FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
    configurer.setTemplateLoaderPaths(DEFAULT_TEMPLATE_LOADER_PATH);
    configurer.setDefaultEncoding(DEFAULT_CHARSET);
    configurer.setPreferFileSystemAccess(false);
    return configurer;
}