title: FreeMarker - Error reading included file "./common/header.txt":
body: <p>I try to use FreeMarker for creating <code>html file</code>.</p>
  
  <p>But when I run program it throws error:</p>
  
  <pre><code>Error reading included file "./common/header.ftl":
  Template "./common/header.ftl" not found.
  
  The failing instruction:
  ==&gt; #include "./common/header.ftl"  [in template "helloworld.ftl" at line 1, column 1]
  </code></pre>
  
  <p><em><strong>helloworld.ftl:</em></strong></p>
  
  <pre><code>&lt;#include "./common/header.ftl"&gt; 
  &lt;#if container??&gt;
    &lt;div ="${container}"&gt;
  &lt;#else&gt;
    &lt;div ="default"&gt;
  &lt;/#if&gt;
  
  &lt;ul&gt;
  &lt;#list systems as system&gt;
  &lt;li&gt;${system_index + 1}.${system.getName()}&lt;/li&gt;
  &lt;/#list&gt;
  &lt;/ul&gt;
  
  &lt;h1&gt;${exampleObject.getName()}&lt;/h1&gt;
  
  &lt;/div&gt;
  
  &lt;#include "./common/footer.ftl"&gt; 
  </code></pre>
  
  <p>snippet of code:</p>
  
  <pre><code>  public static void main(String[] args) {
  
      // Configuration
      Writer file = null;
      Configuration cfg = new Configuration();
  
      try {
        // Set Directory for templates
        cfg.setDirectoryForTemplateLoading(new File("templates"));
        // load template
        Template template = cfg.getTemplate("helloworld.ftl");
  
        // data-model
        Map&lt;String, Object&gt; input = new HashMap&lt;String, Object&gt;();
        input.put("message", "vogella example");
        input.put("container", "test");
  
        // create list
        List&lt;ValueExampleObject&gt; systems = new ArrayList&lt;ValueExampleObject&gt;();
  </code></pre>
  
  <p>inner files <code>header.ftl</code> and <code>footer.ftl</code> are into <code>template/common</code> (into <code>template</code> exactly is helloworld.ftl and common).</p>
  
  <p><strong>- Why this happen?<br>
   - How to solve this trouble?</strong></p>