org.apache.struts2.components.template
类 TemplateEngineManager

java.lang.Object
  继承者 org.apache.struts2.components.template.TemplateEngineManager

public class TemplateEngineManager
extends Object

The TemplateEngineManager will return a template engine for the template


字段摘要
static String DEFAULT_TEMPLATE_TYPE
          The default template extenstion is ftl.
 
构造方法摘要
TemplateEngineManager()
           
 
方法摘要
 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(com.opensymphony.xwork2.inject.Container container)
           
 void setDefaultTemplateType(String type)
           
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

DEFAULT_TEMPLATE_TYPE

public static final String DEFAULT_TEMPLATE_TYPE
The default template extenstion is ftl.

另请参见:
常量字段值
构造方法详细信息

TemplateEngineManager

public TemplateEngineManager()
方法详细信息

setDefaultTemplateType

public void setDefaultTemplateType(String type)

setContainer

public void setContainer(com.opensymphony.xwork2.inject.Container container)

registerTemplateEngine

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.

getTemplateEngine

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 return
templateTypeOverride - Overrides the default template type
返回:
the engine.