623624625626627628629630631632633
{ vw = new VelocityWriter(writer, 4 * 1024, true); } else { vw.recycle(writer); } template.merge(context, vw); } finally {
640641642643644645646647648649650
// 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: " +
879880881882883884885886887888889
{ vw = new VelocityWriter(writer, 4 * 1024, true); } else { vw.recycle(writer); } performMerge(template, context, vw); } finally {
896897898899900901902903904905906
// 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: " +
401402403404405406407408409410411
{ vw = new VelocityWriter( new OutputStreamWriter(output, encoding), 4*1024, true); } else { vw.recycle(new OutputStreamWriter(output, encoding)); } template.merge( context, vw); } finally
109110111112113114115116117118
} catch (IOException e) { throw ArgoException.raise(e); } finally { if (vw != null) vw.recycle(null); } } } }
108109110111112113114115116117118
{ 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);
132133134135136137138139140141142
// 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) {
530531532533534535536537538539540
if (velocityWriter == null) { velocityWriter = new VelocityWriter(writer, WRITER_BUFFER_SIZE, true); } else { velocityWriter.recycle(writer); } template.merge(velocityContext, velocityWriter); } catch (IOException ioe) {
646647648649650651652653654655656
velocityWriter.flush(); // Clear the VelocityWriter's reference to its // internal Writer to allow the latter // to be GC'd while vw is pooled. velocityWriter.recycle(null); writerPool.put(velocityWriter); } writer.flush();