mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
merge with branch issue-38
This commit is contained in:
@@ -42,9 +42,11 @@ import freemarker.template.Configuration;
|
|||||||
import freemarker.template.Template;
|
import freemarker.template.Template;
|
||||||
import freemarker.template.TemplateException;
|
import freemarker.template.TemplateException;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import sonia.scm.ConfigurationException;
|
import sonia.scm.ConfigurationException;
|
||||||
|
import sonia.scm.util.Util;
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
//~--- JDK imports ------------------------------------------------------------
|
||||||
|
|
||||||
@@ -57,7 +59,6 @@ import java.util.Locale;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
import org.slf4j.Logger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -91,20 +92,10 @@ public class FreemarkerTemplateHandler implements TemplateHandler
|
|||||||
@Inject
|
@Inject
|
||||||
public FreemarkerTemplateHandler(ServletContext servletContext)
|
public FreemarkerTemplateHandler(ServletContext servletContext)
|
||||||
{
|
{
|
||||||
try
|
configuration = new Configuration();
|
||||||
{
|
configuration.setServletContextForTemplateLoading(servletContext,
|
||||||
configuration = new Configuration();
|
DIRECTORY_TEMPLATES);
|
||||||
|
configuration.setEncoding(Locale.ENGLISH, ENCODING);
|
||||||
String path = servletContext.getRealPath(DIRECTORY_TEMPLATES);
|
|
||||||
|
|
||||||
configuration.setDirectoryForTemplateLoading(new File(path));
|
|
||||||
configuration.setEncoding(Locale.ENGLISH, ENCODING);
|
|
||||||
}
|
|
||||||
catch (IOException ex)
|
|
||||||
{
|
|
||||||
throw new ConfigurationException(
|
|
||||||
"could not create FreemarkerTemplateHandler", ex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user