In my application, all freemarker templates are in /templates/ftl/ so during the application deployment I load a class I call one class that extends FreemarkerManager and has a method
Configuration configuration = super.createConfiguration(servletContext);
configuration.setDirectoryForTemplateLoading(new File("/templates/ftl/"));
In this way, when I need to load a template file, I can simply do it like this:
ServletContext servletContext = ServletActionContext.getServletContext();
Configuration configFreemarker = (Configuration) servletContext
.getAttribute("freemarker.Configuration");
Template template = configFreemarker.getTemplate("pathToMyTemplate");
In only one specific situation, I need to get a template that comes from completely different path (not the /templates/ftl/).
How can I in this specific moment declare 2nd directory for template loading without breaking all the existing code that were calling the old path? Can I have 2 different starting point for template loading at the same time?
Thanks