velocity-user mailing list archives

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

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

or

 Velocity.evaluate(Context context, |java.io.Writer out, 
java.lang.String logTag, java.io.Reader 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.

Sincerely,
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: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message