1 16 17 package org.springframework.ui.freemarker; 18 19 import java.io.IOException ; 20 21 import freemarker.template.Configuration; 22 import freemarker.template.TemplateException; 23 24 import org.springframework.beans.factory.FactoryBean; 25 import org.springframework.beans.factory.InitializingBean; 26 import org.springframework.context.ResourceLoaderAware; 27 28 53 public class FreeMarkerConfigurationFactoryBean extends FreeMarkerConfigurationFactory 54 implements FactoryBean, InitializingBean, ResourceLoaderAware { 55 56 private Configuration configuration; 57 58 59 public void afterPropertiesSet() throws IOException , TemplateException { 60 this.configuration = createConfiguration(); 61 } 62 63 64 public Object getObject() { 65 return this.configuration; 66 } 67 68 public Class getObjectType() { 69 return Configuration.class; 70 } 71 72 public boolean isSingleton() { 73 return true; 74 } 75 76 } 77 | Popular Tags |