|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.ui.velocity.VelocityEngineUtils
public abstract class VelocityEngineUtils
Utility class for working with a VelocityEngine. Provides convenience methods to merge a Velocity template with a model.
Constructor Summary | |
---|---|
VelocityEngineUtils()
|
Method Summary | |
---|---|
static void |
mergeTemplate(org.apache.velocity.app.VelocityEngine velocityEngine,
String templateLocation,
Map model,
Writer writer)
Merge the specified Velocity template with the given model and write the result to the given Writer. |
static void |
mergeTemplate(org.apache.velocity.app.VelocityEngine velocityEngine,
String templateLocation,
String encoding,
Map model,
Writer writer)
Merge the specified Velocity template with the given model and write the result to the given Writer. |
static String |
mergeTemplateIntoString(org.apache.velocity.app.VelocityEngine velocityEngine,
String templateLocation,
Map model)
Merge the specified Velocity template with the given model into a String. |
static String |
mergeTemplateIntoString(org.apache.velocity.app.VelocityEngine velocityEngine,
String templateLocation,
String encoding,
Map model)
Merge the specified Velocity template with the given model into a String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VelocityEngineUtils()
Method Detail |
---|
public static void mergeTemplate(org.apache.velocity.app.VelocityEngine velocityEngine, String templateLocation, Map model, Writer writer) throws org.apache.velocity.exception.VelocityException
velocityEngine
- VelocityEngine to work withtemplateLocation
- the location of template, relative to Velocity's
resource loader pathmodel
- the Map that contains model names as keys and model objects
as valueswriter
- the Writer to write the result to
org.apache.velocity.exception.VelocityException
- if the template wasn't found or rendering failedpublic static void mergeTemplate(org.apache.velocity.app.VelocityEngine velocityEngine, String templateLocation, String encoding, Map model, Writer writer) throws org.apache.velocity.exception.VelocityException
velocityEngine
- VelocityEngine to work withtemplateLocation
- the location of template, relative to Velocity's
resource loader pathencoding
- the encoding of the template filemodel
- the Map that contains model names as keys and model objects
as valueswriter
- the Writer to write the result to
org.apache.velocity.exception.VelocityException
- if the template wasn't found or rendering failedpublic static String mergeTemplateIntoString(org.apache.velocity.app.VelocityEngine velocityEngine, String templateLocation, Map model) throws org.apache.velocity.exception.VelocityException
When using this method to prepare a text for a mail to be sent with Spring's mail support, consider wrapping VelocityException in MailPreparationException.
velocityEngine
- VelocityEngine to work withtemplateLocation
- the location of template, relative to Velocity's
resource loader pathmodel
- the Map that contains model names as keys and model objects
as values
org.apache.velocity.exception.VelocityException
- if the template wasn't found or rendering failedMailPreparationException
public static String mergeTemplateIntoString(org.apache.velocity.app.VelocityEngine velocityEngine, String templateLocation, String encoding, Map model) throws org.apache.velocity.exception.VelocityException
When using this method to prepare a text for a mail to be sent with Spring's mail support, consider wrapping VelocityException in MailPreparationException.
velocityEngine
- VelocityEngine to work withtemplateLocation
- the location of template, relative to Velocity's
resource loader pathencoding
- the encoding of the template filemodel
- the Map that contains model names as keys and model objects
as values
org.apache.velocity.exception.VelocityException
- if the template wasn't found or rendering failedMailPreparationException
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |