Re: Template output as string after processing

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Friday, March 7, 2008, 5:14:10 PM, code dude wrote:

> Hi List ,
> I have writen a small program where i want output of template
> processing as string not as OutputStreamWriter !! can some one suggest me who to do so ?
>
> Writer out = new OutputStreamWriter(System.out);
> template.process(data, out);
>
> return temp.toString()

It's simple:

Writer out = new StringWriter();
template.process(data, out);
return out.toString()


-- 
Best regards,
 Daniel Dekany


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.