A template resolver which avoids calling ClassLoader.getResource if a template path already has been queried before. This improves performance if caching is enabled in the configuration.
Constructor and description |
---|
MarkupTemplateEngine.CachingTemplateResolver
(Map<String, URL> cache) Creates a new caching template resolver. |
MarkupTemplateEngine.CachingTemplateResolver
() Creates a new caching template resolver using a concurrent hash map as the backing cache. |
Type | Name and description |
---|---|
void |
configure(ClassLoader templateClassLoader, TemplateConfiguration configuration) |
URL |
resolveTemplate(String templatePath) |
Creates a new caching template resolver. The cache implementation being used depends on the use of the template engine. If multiple templates can be rendered in parallel, it must be using a thread-safe cache.
cache
- the backing cacheCreates a new caching template resolver using a concurrent hash map as the backing cache.
Copyright © 2003-2015 The Apache Software Foundation. All rights reserved.