Example usage for org.springframework.ui.freemarker FreeMarkerConfigurationFactoryBean setConfigLocation

List of usage examples for org.springframework.ui.freemarker FreeMarkerConfigurationFactoryBean setConfigLocation

Introduction

In this page you can find the example usage for org.springframework.ui.freemarker FreeMarkerConfigurationFactoryBean setConfigLocation.

Prototype

public void setConfigLocation(Resource resource) 

Source Link

Document

Set the location of the FreeMarker config file.

Usage

From source file:org.hdiv.web.servlet.view.freemarker.FreeMarkerConfigurerTests.java

public void testFreemarkerConfigurationFactoryBeanWithConfigLocation() throws TemplateException {
    FreeMarkerConfigurationFactoryBean fcfb = new FreeMarkerConfigurationFactoryBean();
    fcfb.setConfigLocation(new FileSystemResource("myprops.properties"));
    Properties props = new Properties();
    props.setProperty("myprop", "/mydir");
    fcfb.setFreemarkerSettings(props);/*  w  w w .  j av  a2  s.  c o m*/
    try {
        fcfb.afterPropertiesSet();
        fail("Should have thrown IOException");
    } catch (IOException ex) {
        // expected
    }
}