Hi,
I'm trying to use an include directive in my ftl template which is directly in component. The template which I want to include also uses include directive inside, to include another template. So it's looks like this:
In component I have something like this:
<#include "http://www.interwoven.com/custom/iwov-resources/ftl/template1.ftl">
template1.ftl looks like this:
<#include "http://www.interwoven.com/custom/iwov-resources/ftl/template2.ftl">
and let's say that in template2 is just simple <span> tag with raw text in it.
First include seems to work, but when the second one is called then I recived error message from page, something like this:
freemarker.template.TemplateException: Error reading included file iwov-resources/ftl/template2.ftl
Also I have tried to put relative path inside template1:
<#include "iwov-resources/ftl/template2.ftl">
but this doesn't work either.
Also when I've made small experiment which looks like this:
<#assign
template1 = "http://www.interwoven.com/custom/iwov-resources/ftl/template1.ftl"
template2 = "http://www.interwoven.com/custom/iwov-resources/ftl/template2.ftl"
template3 = "http://www.interwoven.com/custom/iwov-resources/ftl/template3.ftl"
>
<a>${template1}</a>
<br>
<a>${template2}</a>
<br>
<a>${template3}</a>
The result page looks like this:
iwov-resources/ftl/template1.ftl
iwov-resources/ftl/template1.ftl
iwov-resources/ftl/template1.ftl
So my question is. How to solve problem of nested include directives?
oh and tomcat stack trace:
freemarker.template.TemplateException: Error reading included file iwov-resources/ftl/template2.ftl
at freemarker.core.Include.accept(Include.java:167)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.process(Environment.java:190)
at freemarker.template.Template.process(Template.java:237)
at com.interwoven.livesite.runtime.model.page.RuntimeStylesheet.transformFtl(RuntimeStylesheet.java:320)
at com.interwoven.livesite.runtime.model.page.RuntimeStylesheet.transform(RuntimeStylesheet.java:200)
at com.interwoven.livesite.runtime.model.page.RuntimeComponent.transform(RuntimeComponent.java:386)
at com.interwoven.livesite.runtime.model.page.RuntimeComponent.transform(RuntimeComponent.java:341)
at com.interwoven.livesite.runtime.page.PageTokenVariableComponent.transformComponent(PageTokenVariableComponent.java:322)
at com.interwoven.livesite.runtime.page.PageTokenVariableComponent.renderAndCache(PageTokenVariableComponent.java:144)
at com.interwoven.livesite.runtime.page.PageTokenVariableComponent.preRender(PageTokenVariableComponent.java:105)
at com.interwoven.livesite.runtime.page.PageTokenContainer.preRender(PageTokenContainer.java:260)
at com.interwoven.livesite.runtime.model.page.RuntimePage.transformAndOutput(RuntimePage.java:478)
at com.interwoven.livesite.runtime.model.page.RuntimePage.transformAndOutput(RuntimePage.java:459)
at com.interwoven.livesite.runtime.rendering.RenderingManager.doOutputPage(RenderingManager.java:1315)
at com.interwoven.livesite.runtime.rendering.RenderingManager.renderPageGoal(RenderingManager.java:385)
at com.interwoven.livesite.runtime.rendering.RenderingManager.render(RenderingManager.java:255)
at com.interwoven.livesite.runtime.filter.LiveSiteFilter.doFilter(LiveSiteFilter.java:136)
..
Caused by: java.io.FileNotFoundException: Template iwov-resources/ftl/template2.ftl not found.
at freemarker.template.Configuration.getTemplate(Configuration.java:489)
at freemarker.core.Environment.getTemplateForInclusion(Environment.java:1465)
at freemarker.core.Include.accept(Include.java:157)
... 68 more