VIVO-284 ServletContext.getRealPath() requires an absolute path.

This commit is contained in:
Jim Blake 2014-05-08 16:30:32 -04:00
parent 2cd3f36db0
commit a29b61d277

View file

@ -142,7 +142,7 @@ public abstract class FreemarkerConfiguration {
List<TemplateLoader> loaders = new ArrayList<TemplateLoader>(); List<TemplateLoader> loaders = new ArrayList<TemplateLoader>();
// Theme template loader - only if the theme has a template directory. // Theme template loader - only if the theme has a template directory.
String themeTemplatePath = ctx.getRealPath(themeDir) + "/templates"; String themeTemplatePath = ctx.getRealPath("/" + themeDir) + "/templates";
File themeTemplateDir = new File(themeTemplatePath); File themeTemplateDir = new File(themeTemplatePath);
if (themeTemplateDir.exists()) { if (themeTemplateDir.exists()) {
loaders.add(new FreemarkerTemplateLoader(themeTemplateDir)); loaders.add(new FreemarkerTemplateLoader(themeTemplateDir));