velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Eden <>
Subject Re: Velocity parse of a String object
Date Tue, 10 Jun 2003 19:29:02 GMT

 Velocity.evaluate(|Context context, out, 
java.lang.String logTag, java.lang.String instring)|


 Velocity.evaluate(Context context, | out, 
java.lang.String logTag, in)

Using a StringReader for the Reader.
And if you want to write the result to a String, then just use a 
StringWriter for out.

Anthony Eden

Serge Knystautas wrote:

> Is there any way for Velocity to use a String as a template?  I have 2 
> places where I was hoping to use this:
> a. Validation just to check for velocity parse errors before letting 
> someone save a velocity template to the regular resource loader.
> b. Simple scripting for an ad-hoc email message.  (let a user write a 
> simple email message and add some velocity scripting so it populates 
> the name of the recipient in the greeting or subject).
> The only way I can see doing this is expensively creating a manual 
> resource loader that I would wrap around this String.  Is there 
> another way to handle this?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message