velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Jacobson <marti...@libero.it>
Subject Re: getting a mergerd Template as a Document?
Date Wed, 09 Jul 2003 13:52:15 GMT
Richard Dean wrote:
> Hiya,
> 
> Sorry to jump on your bandwagon but I have a similar(-ish) problem. I can
> currently generate an RTF document from a template with velocity. But what I
> want to do after is write that document to a file on the server. I think I
> want to use the java PrintWriter (etc) classes to achieve this but I have no
> idea of where to start really (I am kinda new to velocity). I have looked
> all over the net for answers but I haven't really been able to find anything
> that tackles this issue. If anyone could give a little advice or a pointer
> to somewhere where I can find inspiration it would be greatly appreciated!
> 

A quick look at the JavaDocs leads me to suggest:

java.io.FileWriter f = new java.io.FileWriter("mydocument.rtf");
org.apache.velocity.app.Velocity.mergeTemplate("myrtf.vm", "UTF-8", ctx, f);

Or am I missing something?

HTH,
Martin


---------------------------------------------------------------------
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