title: Spring Freemarker Configuration, Template Not Found
body: <p>I have a Spring/JSF Web application which has a dependency to a module uses Freemarker templates. Here is what i did for integration:</p>
  
  <p>I imported the applicationContext-freemarker-module.xml to applicationContext.xml
  I added the configuration bean to applicationContext-freemarker-module.xml like below.</p>
  
  <pre><code> &lt;bean id="freemarkerConfiguration" class="org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean"&gt;
     &lt;property name="templateLoaderPath" value="classpath*:/"/&gt;
   &lt;/bean&gt;
  </code></pre>
  
  <p>I put my templates to src/main/resources directory of freemarker module. 
  I am reading the templates like below: </p>
  
  <pre><code>ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext-freemarker-module.xml");
  
  Configuration templateConfig = (Configuration) context.getBean("freemarkerConfiguration");
  
  Template template = templateConfig.getTemplate("template.ftl");
  </code></pre>
  
  <p>Now i tried so many values for templateLoaderPath property but i always got the "Template not found." exception.</p>
  
  <p>Freemarker module's JAR is like below</p>
  
  <pre><code>template.ftl
  applicationContext-freemarker-module.xml
  com/.../ (classes)
  META-INF
  </code></pre>
  
  <p>Where should i put the template files and what should i set for templateLoaderPath value?
  I could not understand why "template.ftl" can not be found. I am trying to set the right value for many hours. I tried various path configurations without success.</p>
  
  <p>Thanks a lot for your help,</p>