I have java application packaged into myApplication.jar having following structure:
- com
- mypackages
- templates
..
..
Issue is How do i pass templates location dir to configuration?
I have tried with Spring Resource resource = new ClassPathResource(“/templates/”);
but that throws exception when at resource.getFile()
My Configuration initialization code:
cfg = new Configuration();
cfg.setCacheStorage(new freemarker.cache.MruCacheStorage(20, 250));
cfg.setDirectoryForTemplateLoading(dir);
cfg.setObjectWrapper(new DefaultObjectWrapper());
I found answer here