public class TemplateEngineManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_TEMPLATE_TYPE
The default template extension is
ftl . |
Constructor and Description |
---|
TemplateEngineManager() |
Modifier and Type | Method and Description |
---|---|
TemplateEngine |
getTemplateEngine(Template template,
String templateTypeOverride)
Gets the TemplateEngine for the template name.
|
void |
registerTemplateEngine(String templateExtension,
TemplateEngine templateEngine)
Registers the given template engine.
|
void |
setContainer(Container container) |
void |
setDefaultTemplateType(String type) |
public static final String DEFAULT_TEMPLATE_TYPE
ftl
.public void setDefaultTemplateType(String type)
public void setContainer(Container container)
public void registerTemplateEngine(String templateExtension, TemplateEngine templateEngine)
Registers the given template engine.
Will add the engine to the existing list of known engines.
templateExtension
- filename extension (eg. .jsp, .ftl, .vm).templateEngine
- the engine.public TemplateEngine getTemplateEngine(Template template, String templateTypeOverride)
Gets the TemplateEngine for the template name. If the template name has an extension (for instance foo.jsp), then this extension will be used to look up the appropriate TemplateEngine. If it does not have an extension, it will look for a Configuration setting "struts.ui.templateSuffix" for the extension, and if that is not set, it will fall back to "ftl" as the default.
template
- Template used to determine which TemplateEngine to returntemplateTypeOverride
- Overrides the default template typeCopyright © 2000–2020 Apache Software Foundation. All rights reserved.