Skip to main content
October 16, 2015
Resuelto

Error while reading a included file in FTL

  • October 16, 2015
  • 4 respuestas
  • 1828 visualizaciones

Hi, i am trying to include a html file in the FTL. it is giving 

 Error reading included file content/www/us/en/x/y/jcr:content/rr.html
The problematic instruction:
----------
==> include "${model.privacyPolicyPath}" [on line 50, column 23 in /apps/x/xx/xxx/xxxx/content/legalagreement/er.ftl]


     freemarker.template.TemplateException: Error reading included file content/www/us/en/as/asd/jcr:content/rr.html

please provide your inputs.

Este tema ha sido cerrado para respuestas.
Mejor respuesta de PaulMcMahon

I am not a Freemarker expert but my understanding is that include directive is only applicable for including another Freemarker template, not for including an resource like a HTML page. According to this (http://freemarker.org/docs/app_faq.html#faq_servlet_include) you have to use the include_page directive, however that directive is dependent on use of the FreemarkerServlet, which doesn't apply if you are using a Scripting Engine implementation of Freemarker. Are you using the Sling project's Freemarker scripting engine or something custom. 

4 respuestas

October 16, 2015

we are using  Sling project's Freemarker scripting engine.

PaulMcMahonRespuesta
Level 8
October 16, 2015

I am not a Freemarker expert but my understanding is that include directive is only applicable for including another Freemarker template, not for including an resource like a HTML page. According to this (http://freemarker.org/docs/app_faq.html#faq_servlet_include) you have to use the include_page directive, however that directive is dependent on use of the FreemarkerServlet, which doesn't apply if you are using a Scripting Engine implementation of Freemarker. Are you using the Sling project's Freemarker scripting engine or something custom. 

Sham_HC
Level 10
October 16, 2015

Seems like slash (/) is missing at the beginning.

Adobe Employee
October 16, 2015

Does the node at "/content/www/us/en/as/asd/jcr:content/rr.html" actually exist?