类 FreeMarkerTemplateUtils
- java.lang.Object
- org.springframework.ui.freemarker.FreeMarkerTemplateUtils
public abstract class FreeMarkerTemplateUtils extends Object
Utility class for working with FreeMarker. Provides convenience methods to process a FreeMarker template with a model.- 从以下版本开始:
- 14.03.2004
- 作者:
- Juergen Hoeller
构造器概要
构造器 构造器 说明 FreeMarkerTemplateUtils()
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static StringprocessTemplateIntoString(freemarker.template.Template template, Object model)Process the specified FreeMarker template with the given model and write the result to the given Writer.
构造器详细资料
FreeMarkerTemplateUtils
public FreeMarkerTemplateUtils()
方法详细资料
processTemplateIntoString
public static String processTemplateIntoString(freemarker.template.Template template, Object model) throws IOException, freemarker.template.TemplateException
Process the specified FreeMarker template with the given model and write the result to the given Writer.When using this method to prepare a text for a mail to be sent with Spring's mail support, consider wrapping IO/TemplateException in MailPreparationException.
- 参数:
model- the model object, typically a Map that contains model names as keys and model objects as values- 返回:
- the result as String
- 抛出:
IOException- if the template wasn't found or couldn't be readfreemarker.template.TemplateException- if rendering failed- 另请参阅:
MailPreparationException