public class MustacheTemplateRenderer extends Object implements TemplateRenderer
TemplateRenderer using Mustache with a configurable resource prefix.
Templates should have an mustache extension.| Constructor and Description |
|---|
MustacheTemplateRenderer(String resourcePrefix)
Create a new instance with the resource prefix to use.
|
MustacheTemplateRenderer(String resourcePrefix,
org.springframework.cache.Cache templateCache)
Create a new instance with the resource prefix and the
Cache to use. |
| Modifier and Type | Method and Description |
|---|---|
String |
render(String templateName,
Map<String,?> model)
Render the template with the specified name and the specified model.
|
public MustacheTemplateRenderer(String resourcePrefix, org.springframework.cache.Cache templateCache)
Cache to use.resourcePrefix - the resource prefix to apply to locate a template based on
its nametemplateCache - the cache to use for compiled templates (can be null
to not use caching)public MustacheTemplateRenderer(String resourcePrefix)
resourcePrefix - the resource prefix to apply to locate a template based on
its nameMustacheTemplateRenderer(String, Cache)public String render(String templateName, Map<String,?> model)
TemplateRendererrender in interface TemplateRenderertemplateName - the name of the templatemodel - the model to useCopyright © 2020 Pivotal Software, Inc.. All rights reserved.