From: Keats <ke...@xa...> - 2004-03-02 15:00:45
|
You can still buffer. In fact, AFAIK the entire page is always buffered. The FastWriter is still there in the background. What you lose is the ability to manipulate the buffer. Normally you don't need this, which is why we've hidden the FastWriter. If you need this capability you can still do your own buffering. Anyway I think I understand your problem now. You need a Writer implementation to make your code work, but if you use the Writer from the response you get an InvalidStateException -- presumeably because somewhere else you have already retrieved the OutputStream. You should be able to finesse the problem by constructing a Writer on the OutputStream: Writer out = new OutputStreamWriter(request.getOutputStream(), request.getEncoding()); You may even want to create a subclass of MetaliWriter, eg, MetaliOutputStreamWriter, that does this for you in the constructor. Keats ----- Original Message ----- From: "Tim Pizey" <ti...@pa...> To: <web...@li...> Sent: Tuesday, March 02, 2004 7:07 AM Subject: Re: [WebMacro-user] ANNOUNCE: WebMacro 2.0b1 has been released On Tuesday 02 March 2004 10:30 am, Tim Pizey wrote: > > The Melati Template interface: > > public interface Template { > void write(MelatiWriter out, TemplateContext templateContext, > TemplateEngine engine) throws TemplateEngineException; > } > > This works for Velocity, old WebMacro and JTemplater and probably others. As I (don't) understand it by removing the Writer layer you have removed the ability to buffer, which is vital if you are to use sub-templates (templets). TimP |