public class FreeMarkerRender extends Render
Constructor and Description |
---|
FreeMarkerRender(String view) |
Modifier and Type | Method and Description |
---|---|
static freemarker.template.Configuration |
getConfiguration()
freemarker can not load freemarker.properies automatically
|
String |
getContentType()
继承类可通过覆盖此方法改变 contentType,从而重用 freemarker 模板功能
例如利用 freemarker 实现 FreeMarkerXmlRender 生成 Xml 内容
|
void |
render()
Render to client
|
static void |
setProperties(Properties properties) |
static void |
setProperty(String propertyName,
String propertyValue)
Set freemarker's property.
|
static void |
setSharedVariable(String name,
Object object)
注入对象到 FreeMarker 页面供调用,通常注入一些辅助内容输出的工具类,相当于是 freemarker 的一种扩展方式
|
static void |
setTemplateLoadingPath(String path)
Create public void afterJFinalStart() in YourJFinalConfig and
use this method in MyJFinalConfig.afterJFinalStart() to set
ServletContext for template loading
|
getDevMode, getEncoding, getView, setContext, setContext, setView
public FreeMarkerRender(String view)
public static freemarker.template.Configuration getConfiguration()
public static void setProperty(String propertyName, String propertyValue)
public static void setSharedVariable(String name, Object object)
name
- 对象名object
- 对象public static void setProperties(Properties properties)
public static void setTemplateLoadingPath(String path)
public String getContentType()
Copyright © 2018. All rights reserved.