org.apache.struts2.views.freemarker
类 FreemarkerManager
java.lang.Object
org.apache.struts2.views.freemarker.FreemarkerManager
public class FreemarkerManager
- extends Object
Static Configuration Manager for the FreemarkerResult's configuration
Possible extension points are :-
- createConfiguration method
- loadSettings method
- createTemplateLoader method
- populateContext method
createConfiguration method
Create a freemarker Configuration.
loadSettings method
Load freemarker settings, default to freemarker.properties (if found in classpath)
createTemplateLoader method
create a freemarker TemplateLoader that loads freemarker template in the following order :-
- path defined in ServletContext init parameter named 'templatePath' or 'TemplatePath' (must be an absolute path)
- webapp classpath
- struts's static folder (under [STRUT2_SOURCE]/org/apache/struts2/static/
populateContext method
populate the created model.
INITPARAM_TEMPLATE_PATH
public static final String INITPARAM_TEMPLATE_PATH
- 另请参见:
- 常量字段值
INITPARAM_NOCACHE
public static final String INITPARAM_NOCACHE
- 另请参见:
- 常量字段值
INITPARAM_CONTENT_TYPE
public static final String INITPARAM_CONTENT_TYPE
- 另请参见:
- 常量字段值
DEFAULT_CONTENT_TYPE
public static final String DEFAULT_CONTENT_TYPE
- 另请参见:
- 常量字段值
INITPARAM_DEBUG
public static final String INITPARAM_DEBUG
- 另请参见:
- 常量字段值
KEY_REQUEST
public static final String KEY_REQUEST
- 另请参见:
- 常量字段值
KEY_INCLUDE
public static final String KEY_INCLUDE
- 另请参见:
- 常量字段值
KEY_REQUEST_PRIVATE
public static final String KEY_REQUEST_PRIVATE
- 另请参见:
- 常量字段值
KEY_REQUEST_PARAMETERS
public static final String KEY_REQUEST_PARAMETERS
- 另请参见:
- 常量字段值
KEY_SESSION
public static final String KEY_SESSION
- 另请参见:
- 常量字段值
KEY_APPLICATION
public static final String KEY_APPLICATION
- 另请参见:
- 常量字段值
KEY_APPLICATION_PRIVATE
public static final String KEY_APPLICATION_PRIVATE
- 另请参见:
- 常量字段值
KEY_JSP_TAGLIBS
public static final String KEY_JSP_TAGLIBS
- 另请参见:
- 常量字段值
ATTR_TEMPLATE_MODEL
public static final String ATTR_TEMPLATE_MODEL
- 另请参见:
- 常量字段值
KEY_REQUEST_PARAMETERS_STRUTS
public static final String KEY_REQUEST_PARAMETERS_STRUTS
- 另请参见:
- 常量字段值
KEY_HASHMODEL_PRIVATE
public static final String KEY_HASHMODEL_PRIVATE
- 另请参见:
- 常量字段值
EXPIRATION_DATE
public static final String EXPIRATION_DATE
CONFIG_SERVLET_CONTEXT_KEY
public static final String CONFIG_SERVLET_CONTEXT_KEY
- 另请参见:
- 常量字段值
KEY_EXCEPTION
public static final String KEY_EXCEPTION
- 另请参见:
- 常量字段值
FreemarkerManager
public FreemarkerManager()
setEncoding
public void setEncoding(String encoding)
setWrapperAltMap
public void setWrapperAltMap(String val)
setCacheBeanWrapper
public void setCacheBeanWrapper(String val)
setMruMaxStrongSize
public void setMruMaxStrongSize(String size)
setTemplateUpdateDelay
public void setTemplateUpdateDelay(String delay)
setContainer
public void setContainer(com.opensymphony.xwork2.inject.Container container)
setFileManagerFactory
public void setFileManagerFactory(com.opensymphony.xwork2.FileManagerFactory fileManagerFactory)
setThemeTemplateLoader
public void setThemeTemplateLoader(FreemarkerThemeTemplateLoader themeTemplateLoader)
getNoCharsetInContentType
public boolean getNoCharsetInContentType()
getTemplatePath
public String getTemplatePath()
getNocache
public boolean getNocache()
getDebug
public boolean getDebug()
getConfig
public freemarker.template.Configuration getConfig()
getWrapper
public freemarker.template.ObjectWrapper getWrapper()
getContentType
public String getContentType()
getConfiguration
public freemarker.template.Configuration getConfiguration(javax.servlet.ServletContext servletContext)
init
public void init(javax.servlet.ServletContext servletContext)
throws freemarker.template.TemplateException
- 抛出:
freemarker.template.TemplateException
addSetting
public void addSetting(String name,
String value)
throws freemarker.template.TemplateException
- 抛出:
freemarker.template.TemplateException
buildTemplateModel
public ScopesHashModel buildTemplateModel(com.opensymphony.xwork2.util.ValueStack stack,
Object action,
javax.servlet.ServletContext servletContext,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
freemarker.template.ObjectWrapper wrapper)