title: Apache Tiles 3 with Freemarker basic setup, not working
body: <p>I have not been able to get a very simple freemarker template working with Tiles 3. The examples on the site seem to be for version 2.x as the programmatic configuration references classes that don't exist in tiles 3.</p>
  
  <p>With the following cofiguration, my template displays as is (that is it does not include any tiles). How can I fix this?</p>
  
  <p><strong>When rendering page:</strong>
  When using the url: <code>http://localhost:8080/TilesFreeMarker/myapp.homepage.tiles</code> I get exactly the same content as it in the templage.ftl file below. If I replace all ftl files with jsp's (and the required tags) the example then behaves as expected, but I require freemarker functionality.</p>
  
  <p><strong>Web.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns="http://java.sun.com/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
           version="3.0"&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;org.apache.tiles.extras.complete.CompleteAutoloadTilesListener&lt;/listener-class&gt;
      &lt;/listener&gt;
      &lt;!-- Configure so anything ending in .tiles will be processed by tiles --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;Tiles Dispatch Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.apache.tiles.web.util.TilesDispatchServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Tiles Dispatch Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.tiles&lt;/url-pattern&gt;s
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>template.ftl</strong></p>
  
  <pre><code>&lt;#assign tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]&gt;
  &lt;!DOCTYPE&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;
          &lt;@tiles.getAsString name="title"/&gt;
      &lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
          &lt;table&gt;
        &lt;tr&gt;
          &lt;td colspan="2"&gt;
              &lt;@tiles.insertAttribute name="header"/&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
              &lt;@tiles.insertAttribute name="menu"/&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;@tiles.insertAttribute name="body"/&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td colspan="2"&gt;
              &lt;@tiles.insertAttribute name="footer"/&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  &lt;/#assign&gt;
  </code></pre>
  
  <p><strong>header.ftl</strong></p>
  
  <pre><code>&lt;div&gt;The Header&lt;/div&gt;
  </code></pre>
  
  <p><strong>menu.ftl</strong></p>
  
  <pre><code>&lt;ul&gt;
      &lt;li&gt;Menu Item&lt;/li&gt;
      &lt;li&gt;Menu Item&lt;/li&gt;
      &lt;li&gt;Menu Item&lt;/li&gt;
      &lt;li&gt;Menu Item&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p><strong>body.ftl</strong></p>
  
  <pre><code>&lt;div&gt;The Body&lt;/div&gt;
  </code></pre>
  
  <p><strong>footer.ftl</strong></p>
  
  <pre><code>&lt;div&gt;The Footer&lt;/div&gt;
  </code></pre>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.quaternion&lt;/groupId&gt;
      &lt;artifactId&gt;TilesFreeMarker&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
  
      &lt;name&gt;TilesFreeMarker&lt;/name&gt;
  
      &lt;properties&gt;
          &lt;endorsed.dir&gt;${project.build.directory}/endorsed&lt;/endorsed.dir&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tiles&lt;/groupId&gt;
              &lt;artifactId&gt;tiles-extras&lt;/artifactId&gt;
              &lt;version&gt;3.0.5&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax&lt;/groupId&gt;
              &lt;artifactId&gt;javaee-web-api&lt;/artifactId&gt;
              &lt;version&gt;6.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.6&lt;/source&gt;
                      &lt;target&gt;1.6&lt;/target&gt;
                      &lt;compilerArguments&gt;
                          &lt;endorseddirs&gt;${endorsed.dir}&lt;/endorseddirs&gt;
                      &lt;/compilerArguments&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.1.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.1&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;validate&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;copy&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;outputDirectory&gt;${endorsed.dir}&lt;/outputDirectory&gt;
                              &lt;silent&gt;true&lt;/silent&gt;
                              &lt;artifactItems&gt;
                                  &lt;artifactItem&gt;
                                      &lt;groupId&gt;javax&lt;/groupId&gt;
                                      &lt;artifactId&gt;javaee-endorsed-api&lt;/artifactId&gt;
                                      &lt;version&gt;6.0&lt;/version&gt;
                                      &lt;type&gt;jar&lt;/type&gt;
                                  &lt;/artifactItem&gt;
                              &lt;/artifactItems&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>