Re: Template Caching doesn't work

chintan4181 <[email protected]> Mon, 22 Apr 2013 06:34:39 -0700 (PDT)
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
If i don't set configuration.setTemplateLoader(ftl); then it gives me an
exception saying "Template not found". 

I am loading template from physical location. 

	String templateDir = "C:\\workspace\\static-artifacts\\email-templates";
		String templateFileName = "mail-template.ftl";

This is how i am using above to variables

private String getContent(String templateFileName, String templatedir,
java.util.Map<String, Object> dynamicParams) throws Exception {
		
		if(ftl == null)
			ftl = new FileTemplateLoader(new File(templatedir));		
		//if i comment below line, then i am getting "template not found"
exception
		configuration.setTemplateLoader(ftl);

		template = configuration.getTemplate(templateFileName);
		
		String result =
FreeMarkerTemplateUtils.processTemplateIntoString(template, dynamicParams);
		
		return result;





--
View this message in context: http://freemarker.624813.n4.nabble.com/Template-Caching-doesn-t-work-tp4654527p4654529.html
Sent from the freemarker-user mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter