Uploaded image for project: 'Tiles'
  1. Tiles
  2. TILES-594

Struts 2 apache tiles freemarker template loading issue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • 2.2.2
    • None
    • tiles-freemarker
    • None

    Description

      We have a struts 2 tiles application and we are using freemarker for views. We are migrating to struts 2.3.34 from 2.3.15. In the below tiles definition, the template file is not getting loaded by freemarker and it is not being parsed. Instead the content in depositLayout.ftl is rendered without being parsed.

      The options.ftl file is loaded by freemarker and rendered properly.

      <!DOCTYPE tiles-definitions PUBLIC
      "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
      "http://tiles.apache.org/dtds/tiles-config_2_1.dtd">

      <tiles-definitions>
      <definition name="deposit" template="/layouts/deposits/depositLayout.ftl">
      <put-attribute name="body" value="/deposits/options.ftl" />
      </definition>
      </tiles-definitions>
      We are using below version jars and loaded all the required jars.

      struts2-core-2.3.34.jar
      struts2-spring-plugin-2.3.34.jar
      struts2-tiles-plugin-2.3.34.jar
      tiles-api-2.2.2.jar
      tiles-core-2.2.2.jar
      tiles-jsp-2.2.2.jar
      tiles-servlet-2.2.2.jar
      xwork-core-2.3.34.jar
      tiles-ognl-2.2.2.jar
      freemarker-2.3.22.jar
      tiles-freemarker-2.2.2.jar
      tiles-el-2.2.2.jar
      ognl-3.0.21.jar
      tiles-template-2.2.2.jar

      I have enabled the log trace for tiles and freemarker and below is the log.

      Initializing Tiles2 container. . .<br/>
      Tiles2 container initialization complete.<br/>
      Publishing TilesContext for context: org.apache.catalina.core.ApplicationContextFacade<br/>
      Using object wrapper of class freemarker.template.DefaultObjectWrapper<br/>
      Rendering freemarker tile ...<br/>
      Adding support for Tiles tags, please remember to register {} in web.xml!<br/>
      TemplateLoader.findTemplateSource("layouts/deposits/head.ftl"): Found<br/>
      Can any one help me why the apache tiles is not able to load the template specified as an attribute in defintion tag and not parsing it with freemarker? The same ftl is rendered if i specify as an attribute to the definition tag. If I specify a jsp file as a template, it is working fine.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jeevanragula Jeevan Reddy Ragula
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: