@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -45,6 +45,7 @@ public abstract class FreeMarkerTemplateUtils {
|
||||
*/
|
||||
public static String processTemplateIntoString(Template template, Object model)
|
||||
throws IOException, TemplateException {
|
||||
|
||||
StringWriter result = new StringWriter();
|
||||
template.process(model, result);
|
||||
return result.toString();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,9 +28,9 @@ import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
|
||||
/**
|
||||
* FreeMarker TemplateLoader adapter that loads via a Spring ResourceLoader.
|
||||
* Used by FreeMarkerConfigurationFactory for any resource loader path that
|
||||
* cannot be resolved to a java.io.File.
|
||||
* FreeMarker {@link TemplateLoader} adapter that loads via a Spring {@link ResourceLoader}.
|
||||
* Used by {@link FreeMarkerConfigurationFactory} for any resource loader path that cannot
|
||||
* be resolved to a {@link java.io.File}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 14.03.2004
|
||||
@@ -63,6 +63,7 @@ public class SpringTemplateLoader implements TemplateLoader {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Object findTemplateSource(String name) throws IOException {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Looking for FreeMarker template with name [" + name + "]");
|
||||
@@ -84,7 +85,6 @@ public class SpringTemplateLoader implements TemplateLoader {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public long getLastModified(Object templateSource) {
|
||||
Resource resource = (Resource) templateSource;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user