Class SpringTemplateLoader
java.lang.Object
org.springframework.ui.freemarker.SpringTemplateLoader
- All Implemented Interfaces:
freemarker.cache.TemplateLoader
FreeMarker
TemplateLoader
adapter that loads template files via a
Spring ResourceLoader
.
Used by FreeMarkerConfigurationFactory
for any resource loader path
that cannot be resolved to a File
.
- Since:
- 14.03.2004
- Author:
- Juergen Hoeller
- See Also:
-
FreeMarkerConfigurationFactory.setTemplateLoaderPath(java.lang.String)
Configuration.setDirectoryForTemplateLoading(java.io.File)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSpringTemplateLoader
(ResourceLoader resourceLoader, String templateLoaderPath) Create a newSpringTemplateLoader
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
closeTemplateSource
(Object templateSource) findTemplateSource
(String name) long
getLastModified
(Object templateSource)
-
Field Details
-
logger
protected final org.apache.commons.logging.Log logger
-
-
Constructor Details
-
SpringTemplateLoader
Create a newSpringTemplateLoader
.- Parameters:
resourceLoader
- the Spring ResourceLoader to usetemplateLoaderPath
- the template loader path to use
-
-
Method Details
-
findTemplateSource
- Specified by:
findTemplateSource
in interfacefreemarker.cache.TemplateLoader
- Throws:
IOException
-
getReader
- Specified by:
getReader
in interfacefreemarker.cache.TemplateLoader
- Throws:
IOException
-
getLastModified
- Specified by:
getLastModified
in interfacefreemarker.cache.TemplateLoader
-
closeTemplateSource
- Specified by:
closeTemplateSource
in interfacefreemarker.cache.TemplateLoader
- Throws:
IOException
-