109110111112113114115116117118119
{ vw = new VelocityWriter(pw, 4 * 1024, true); } else { vw.recycle(pw); } // Place the VelocityWriter into the Context context.put(VELOCITY_WRITER_ATTR, vw); template.merge(context, vw);
133134135136137138139140141142143
// nicely with others. vw.flush(); /* This hack sets the VelocityWriter's internal ref to the * PrintWriter to null to keep memory free while * the writer is pooled. See bug report #18951 */ vw.recycle(null); writerPool.put(vw); } } catch (Exception e) {
585586587588589590591592593594595
{ vw = new VelocityWriter(writer, 4 * 1024, true); } else { vw.recycle(writer); } template.merge(context, vw); } finally {
602603604605606607608609610611612
// nicely with others. vw.flush(); /* This hack sets the VelocityWriter's internal ref to the * PrintWriter to null to keep memory free while * the writer is pooled. See bug report #18951 */ vw.recycle(null); writerPool.put(vw); } catch (Exception e) { Velocity.debug("VelocityViewServlet: " +
653654655656657658659660661662663
{ vw = new VelocityWriter(writer, 4 * 1024, true); } else { vw.recycle(writer); } performMerge(template, context, vw); } finally {
670671672673674675676677678679680
// nicely with others. vw.flush(); /* This hack sets the VelocityWriter's internal ref to the * PrintWriter to null to keep memory free while * the writer is pooled. See bug report #18951 */ vw.recycle(null); writerPool.put(vw); } catch (Exception e) { velocity.debug("VelocityViewServlet: " +
391392393394395396397398399400401
{ vw = new VelocityWriter( new OutputStreamWriter(output, encoding), 4*1024, true); } else { vw.recycle(new OutputStreamWriter(output, encoding)); } template.merge( context, vw); } finally
4142434445464748495051
try { template.merge(context, vw); vw.flush(); } finally { vw.recycle(null); } } /** * Let subclass do some initial work after Velocity context prepared.
865866867868869870871872873874875
882883884885886887888889890891892
// nicely with others. vw.flush(); /* This hack sets the VelocityWriter's internal ref to the * PrintWriter to null to keep memory free while * the writer is pooled. See bug report #18951 */ vw.recycle(null); writerPool.put(vw); } catch (Exception e) { getLog().error("Trouble releasing VelocityWriter: " +