Hi Evan, > Here's what I'm doing: I've written a reusable html-control model for > creating html components within the struts framework using velocity. These > components use velocity themselves to render their content. These controls > may also themselves contain other sub-controls, and so on. It seems > ineffecient for me for each of these sub-controls, to have to create a > single large string and return it to its parent control to render it. I > would rather pass a writer down through the execution hierarchy having each > subcontrol add its output to the parents writer, thus using a single writer > to achieve the total output, instead of a segmented writer.toString -> > writer.toString -> writer.toString sort of process. > > Does that make more sense?
If all the components uses Velocity to render the content, you must be using Template#merge or Velocity(Engine)#mergeTemplate or Velocity(Engine)#evaluate in each of your components, correct? If so, you can just put the Writer in the Context before rendering. context.put("writer", writer) And in the template, $component.render($writer) Best regards, -- Shinobu -- Shinobu Kawai <[EMAIL PROTECTED]> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]