Template output as string after processing

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Template output as string after processing

code dude
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()



-------------------------------------------------------------------------
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/
_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Reply | Threaded
Open this post in threaded view
|

Re: Template output as string after processing

Daniel Dekany
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/
_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Reply | Threaded
Open this post in threaded view
|

Re: Template output as string after processing

vasanth
Thank you daniel .. its working ..