Re: adding a new template to an existing FreeMarker system

Daniel Dekany <[email protected]> Thu, 9 Jun 2016 00:48:49 +0200
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
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 [email protected], 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


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e