This may be a newbie question, but I'm trying to figure out which of the
following two methods is better for performing the template merge and
outputting it in a servlet?
Using the HttpServletResponse's Writer object?
Writer writer = response().getWriter();
template.merge(context, writer);
writer.close();
OR
the VelocityViewServlet way with the WriterPool and VelocityWriter?
vw = (VelocityWriter) writerPool.get();
if (vw == null)
{
vw = new VelocityWriter( new OutputStreamWriter(output,
encoding), 4*1024, true);
}
else
{
vw.recycle(new OutputStreamWriter(output, encoding));
}
template.merge( context, vw);
Thanks
John