From: Lane S. <la...@op...> - 2004-03-02 18:02:44
|
Tim, Keats has pointed out a way to construct a writer. Is this helpful? -Lane Keats wrote: >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 > > > > >------------------------------------------------------- >SF.Net is sponsored by: Speed Start Your Linux Apps Now. >Build and deploy apps & Web services for Linux with >a free DVD software kit from IBM. Click Now! >http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click >_______________________________________________ >Webmacro-user mailing list >Web...@li... >https://lists.sourceforge.net/lists/listinfo/webmacro-user > > > -- Lane Sharman For Protection from SPAM and Virus, Extend to the Network Your Perimeter of Defense: http://www.opendoors.com 858-755-2868 |