NIHVIVO-3729 Don't fetch the FreemarkerConfiguration only to pass it through 6 levels of calls. Instead, get it from the FreemarkerConfigurationLoader when you need it.

This commit is contained in:
j2blake 2012-04-20 20:51:33 +00:00
parent 028d367461
commit 584a88d687

View file

@ -24,7 +24,6 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.Tem
import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions; import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler; import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler;
import freemarker.template.Configuration;
/** /**
* Services a visualization request. This will return a simple error message and a 501 if * Services a visualization request. This will return a simple error message and a 501 if
@ -74,10 +73,9 @@ public class AjaxVisualizationController extends FreemarkerHttpServlet {
if (ajaxResponse instanceof TemplateResponseValues) { if (ajaxResponse instanceof TemplateResponseValues) {
Configuration config = getConfig(vreq);
TemplateResponseValues trv = (TemplateResponseValues) ajaxResponse; TemplateResponseValues trv = (TemplateResponseValues) ajaxResponse;
try { try {
writeTemplate(trv.getTemplateName(), trv.getMap(), config, request, response); writeTemplate(trv.getTemplateName(), trv.getMap(), vreq, response);
} catch (TemplateProcessingException e) { } catch (TemplateProcessingException e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }