Hello;
I created a template file FTL and stored it in a specific folder in Alfresco repository. inside i have a java backed webscript. I want to load the template file into my Java backed webscript to use it to create an XML file.
I use the freemarker API to load the template, i use this method to load this FTL file :
freemarker.template.Configuration.getTemplate(TEMPLATE_NAME)
But i still getting this error:
java.io.FileNotFoundException: Template "contentModelTemplate.xml.ftl"
I used the FTL file PATH, and the name of the file as arguement to this method to load the template, but i still getting the same error.
Can you tell me how to fix this, and how to load ftl template file in Java?
You should not use the FreeMarker API directly. Alfresco provides a TemplateService that you can use to invoke template engines, and by specifying a classpath for an FTL file Alfresco will delegate the execution of the template to the FreeMarker engine internally.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.