[stringtemplate-interest] Generating big documents
Nate
misc at n4te.com
Wed Dec 27 11:04:39 PST 2006
You could try something like this...
ArrayList list = new ArrayList();
list.add("10");
list.add("20");
list.add("30");
StringTemplate template = new StringTemplate("$data:{$i$ == $it$\n}$");
template.setAttribute("data", list.iterator());
System.out.println(template.toString());
Outputs...
1 == 10
2 == 20
3 == 30
-Nate
Adam Bennett wrote:
> Our web application has the ability to generate reports as HTML or XML
> documents. These documents are potentially very large (20MB with some
> of our test data). Early on we had problems with the server running
> out of memory while generating these because all the data was brought
> into memory from the database. Our solution was to stream the results
> from the database while generating the document.
>
> Can StringTemplate be used to generate such documents? I cannot see
> how to avoid bringing all the data into memory because StringTemplate
> requires all data to be passed as an attribute.
> ------------------------------------------------------------------------
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
>
More information about the stringtemplate-interest
mailing list