public class FreemarkerUtil extends Object
| Constructor and Description |
|---|
FreemarkerUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
renderToFile(Map dataItems,
String templateName,
String outFilePath)
渲染到文件
|
static String |
renderToStr(Map dataItems,
String templateName)
渲染到字符串
|
public static String renderToStr(Map dataItems, String templateName) throws IOException, freemarker.template.TemplateException
dataItems - datatemplateName - template nameIOException - IOExceptionfreemarker.template.TemplateException - TemplateExceptionpublic static void renderToFile(Map dataItems, String templateName, String outFilePath) throws IOException, freemarker.template.TemplateException
dataItems - datatemplateName - template nameoutFilePath - 文件路径 可以是绝对路径、相对路径IOException - IOExceptionfreemarker.template.TemplateException - TemplateExceptionCopyright © 2016 Le. All rights reserved.