Re: [FreeMarker-user] adding a new template to an existing FreeMarker system
Generates text that depends on changing data (like dynamic HTML).
Brought to you by:
revusky
From: Daniel D. <dd...@fr...> - 2016-06-08 22:48:58
|
Hi, FreeMarker is very configurable on this regard, an it doesn't even have a default location for templates, so everyone has to configure it to something explicitly. But you can try a few things: - See if there's something like templateLoader or template_loader or maybe templatePath or templatePaths around. This is what specifies from where the templates are loaded from. But maybe they do it from compiled Java code, in which case you can't easily modify it. - Find the existing templates (usually files with "ftl" file extension). If they are inside jar-s, then maybe you can just add your own jar-s which put further templates into the same subdirectory. - If they are using a well known framework (like Spring), chances are that it has its own conventions for configuring FreeMarker, and knowing that maybe you can refine it. - Start the JVM in debug mode, and put a breakpoint on freemarker.cache.TemplateCache.findTemplateSource(String). You will see a TemplateLoader field referred there. That's the object that's responsible for actually loading the template files, so from its concrete class and fields you can extract this information. And please in the future use de...@fr..., as this is list was retired! Wednesday, June 8, 2016, 9:26:53 PM, spornitz wrote: > Hi; > > We are using a vendor's system that uses FreeMarker. We would like to add a > couple templates to their existing system; they can't seem to tell us what > we would have to change to have the templating engine pick them up, however. > > Generally: what do you have to change in a FreeMarker-based application to > have the template engine pick up brand new templates? > > thanks for any clues... -- Thanks, Daniel Dekany |