Java 类org.springframework.ui.freemarker.FreeMarkerConfigurationFactory 实例源码

项目:uaa-service    文件:TemplateConfig.java   
@Bean
public FreeMarkerConfigurer freemarkerConfig() throws IOException, TemplateException {
    final FreeMarkerConfigurationFactory factory = new FreeMarkerConfigurationFactory();

    // If overwritten use path of user
    if (isNotBlank(uaaProperties.getTemplatePath())) {
        final TemplateLoader templateLoader = getTemplateLoader(uaaProperties.getTemplatePath());
        factory.setPreTemplateLoaders(templateLoader);
    }

    // Default configurations
    factory.setPostTemplateLoaders(getTemplateLoader("classpath:/templates/"));
    factory.setDefaultEncoding("UTF-8");

    final FreeMarkerConfigurer result = new FreeMarkerConfigurer();
    result.setConfiguration(factory.createConfiguration());
    return result;
}
项目:TeeFun    文件:MvcConfig.java   
@Bean
public FreeMarkerConfigurer getFreemarkerConfig() throws IOException, TemplateException {
    final FreeMarkerConfigurationFactory factory = new FreeMarkerConfigurationFactory();
    factory.setTemplateLoaderPath("/WEB-INF/views/");
    factory.setDefaultEncoding("UTF-8");
    final Properties properties = new Properties();
    properties.put("auto_import", "spring.ftl as spring");
    properties.put("template_exception_handler", "rethrow");
    factory.setFreemarkerSettings(properties);
    final Map<String, Object> sharedVariables = new HashMap<String, Object>();
    sharedVariables.put("include", this.freemarkerIncludeDirective);
    factory.setFreemarkerVariables(sharedVariables);
    factory.setPreferFileSystemAccess(false);

    final FreeMarkerConfigurer result = new FreeMarkerConfigurer();
    // FIXME factory not working
    // result.setConfiguration(factory.createConfiguration());
    result.setTemplateLoaderPath("/WEB-INF/views/");
    result.setFreemarkerVariables(sharedVariables);
    result.setFreemarkerSettings(properties);

    return result;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:FreeMarkerAutoConfiguration.java   
protected void applyProperties(FreeMarkerConfigurationFactory factory) {
    factory.setTemplateLoaderPaths(this.properties.getTemplateLoaderPath());
    factory.setPreferFileSystemAccess(this.properties.isPreferFileSystemAccess());
    factory.setDefaultEncoding(this.properties.getCharsetName());
    Properties settings = new Properties();
    settings.putAll(this.properties.getSettings());
    factory.setFreemarkerSettings(settings);
}
项目:spring-boot-concourse    文件:FreeMarkerAutoConfiguration.java   
protected void applyProperties(FreeMarkerConfigurationFactory factory) {
    factory.setTemplateLoaderPaths(this.properties.getTemplateLoaderPath());
    factory.setPreferFileSystemAccess(this.properties.isPreferFileSystemAccess());
    factory.setDefaultEncoding(this.properties.getCharsetName());
    Properties settings = new Properties();
    settings.putAll(this.properties.getSettings());
    factory.setFreemarkerSettings(settings);
}
项目:contestparser    文件:FreeMarkerAutoConfiguration.java   
protected void applyProperties(FreeMarkerConfigurationFactory factory) {
    factory.setTemplateLoaderPaths(this.properties.getTemplateLoaderPath());
    factory.setPreferFileSystemAccess(this.properties.isPreferFileSystemAccess());
    factory.setDefaultEncoding(this.properties.getCharsetName());
    Properties settings = new Properties();
    settings.putAll(this.properties.getSettings());
    factory.setFreemarkerSettings(settings);
}
项目:onetwo    文件:WebFtlsContextConfig.java   
protected void applyProperties(FreeMarkerConfigurationFactory factory) {
    factory.setTemplateLoaderPaths(this.properties.getTemplateLoaderPath());
    factory.setPreferFileSystemAccess(this.properties.isPreferFileSystemAccess());
    factory.setDefaultEncoding(this.properties.getCharsetName());
    Properties settings = new Properties();
    settings.putAll(this.properties.getSettings());
    factory.setFreemarkerSettings(settings);
}
项目:easycode    文件:FreemarkerTemplateProcessor.java   
public FreeMarkerConfigurationFactory getFreeMarkerConfigurationFactory() {
    return freeMarkerConfigurationFactory;
}
项目:easycode    文件:FreemarkerTemplateProcessor.java   
public void setFreeMarkerConfigurationFactory(FreeMarkerConfigurationFactory freeMarkerConfigurationFactory) {
    this.freeMarkerConfigurationFactory = freeMarkerConfigurationFactory;
}
项目:spring-ws-test    文件:FreeMarkerTemplateProcessor.java   
public FreeMarkerConfigurationFactory getConfigurationFactory() {
    return configurationFactory;
}
项目:spring-ws-test    文件:FreeMarkerTemplateProcessor.java   
public void setConfigurationFactory(FreeMarkerConfigurationFactory configurationFactory) {
    this.configurationFactory = configurationFactory;
}