Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
The way in which FreeMarkerTemplateEngine.generate(..) setup the Template will not allows including another Template, as in:
<#include "merge/merge.ftl"/>
The proper way to do this is to create a org.freemarker.template.Configuration and get the template via the configuration instance;
config = new Configuration();
Template template = config.getTemplate(templateName + ".ftl");
template.process(contextObjects, out);
I have attached a MultiLoaderFTLEngine which does it as shown above together an assocaited test case. In additional, it is possible to specify/override the default TemplateLoader. This make it possible for user to provide their own templates, overiding those in the orginal plugin.
Hi Jack,
It seems that code you provided inside attachment is for some xdoclet plugin ( appfuse? ) - an dnot for generama.
What about patch against current CVS version of generama
( I do not use fm nyself, so you are better qualified person to do this... )
regards,