Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 75805 invoked by uid 500); 29 Mar 2001 00:43:01 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Delivered-To: moderator for cocoon-dev@xml.apache.org Received: (qmail 16564 invoked from network); 29 Mar 2001 00:12:08 -0000 Message-ID: <19C34CD863B1D4118E2800508BAF663A11C1F1@STONE> From: Soo Kang Wei FSI NCS To: "'cocoon-dev@xml.apache.org'" Subject: RE: C2: trouble getting streaming to work as expected Date: Thu, 29 Mar 2001 07:59:31 +0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Hi, May I know where can I download Cocoon 2 as I could't find it in the download site. The latest version is 1.8.2 as I could see. Is that considered Cocoon2? Thank you. Regards, Soo Kang Wei -----Original Message----- From: McCoy, David [mailto:dmccoy@gohealthcast.com] Sent: Thursday, March 29, 2001 4:20 AM To: 'cocoon-dev@xml.apache.org' Subject: RE: C2: trouble getting streaming to work as expected Thank you. That will help us out tremendously. You are a lifesaver. David McCoy -----Original Message----- From: Berin Loritsch [mailto:bloritsch@apache.org] Sent: Wednesday, March 28, 2001 11:28 AM To: cocoon-dev@xml.apache.org Subject: Re: C2: trouble getting streaming to work as expected "McCoy, David" wrote: > > Could you elaborate on what would be necessary to install a > DeterministicXMLSerializer in to Cocoon? It's not that difficult. Once you create the XMLSerializer, you add it to the list of serializers in cocoon.xconf: When you want to explicitly use the serializer in the map then do something like this: NOTE: you can make the deterministic serializer the default type. In that case, you can omit the "type" attribute. Cocoon always sets the output stream explicitly for Serializers and Readers. Basically, in a Servlet environment, it works like this: Serializer serializer = (Serializer) serializerSelector.select("deterministic"); serializer.setOutputStream(response.getOutputStream()); As you can see, you are still at the mercy of the Servlet Engine for the type of output streams. To ensure serialization continues, just remember to flush() after every write. For your quicker pages that don't take a long time to generate this serializer will be painfully slow. For your more intensive and slowly generated pages, this serializer will be PERCEIVED as faster mainly because you are seeing results as they come. The measured time between the Buffered IO and the unbuffered IO will almost always favor the buffered IO. In many cases though, it is _perceived_ speed that is more important than _measured_ speed. > -----Original Message----- > From: Berin Loritsch [mailto:bloritsch@apache.org] > Sent: Tuesday, March 27, 2001 12:09 PM > To: cocoon-dev@xml.apache.org > Subject: Re: C2: trouble getting streaming to work as expected > > "Lock, Fred" wrote: > > > > Hello, > > > > My partner and I are using the enclosed XSP (see below) to experiment with > > the streaming capabilities of C2. We are applying the > dynamic-page2html.xsl > > which comes with the C2 distribution to format the output. We are using IE > > version 5.5 to view the output. C2 is running on Tomcat 3.2.1. > > > > We expect that when we hit the XSP we should see the browser displaying a > > new integer number on successive lines every 0.5 seconds. > > > > However, what actually happens is that we wait approximately 70 seconds, > and > > then integers 0 through 131 are displayed. We then wait another 70 seconds > > and integers 132 through 268 are displayed, etc. > > > > It appears that the output is being cached, then streamed out, cached, > etc. > > > > Is there some way to reduce this cache, or force a flush? > > Cocoon will use the BufferedOutputStream in just about every circumstance > because > it is faster to the end user. If you need deterministic timing on the > serializer, > then you need a "DeterministicXMLSerializer" or something like that and > perform > flush()es on each nugget of information. Since Cocoon is designed for a > transaction > oriented environment, the notion of what you are trying to due goes against > how > Cocoon is designed to be used. > > This is the same with most Server Side Processing in a Web environment. A > transaction > occurs from request to response. Once the response is fully sent, the > transaction > is done. There really isn't the notion of a progressive transaction. > > What is the end result that you envision by having a deterministic response > on > the client browser? I guarantee that once you start embedding that > information > in tables, Netscape won't display the information until the table is closed > (all > at once). > > > > > Thanks, > > Fred > > > > ================================================================= > > XSP file to experiment with C2 streaming. > > dynamic-page2html.xsl is used to style the output. > > ================================================================= > > > > > > > > > language="java" > > xmlns:xsp="http://apache.org/xsp" > > > > > > > A Simple XSP Page > > > > Some page content > > > > for (int i = 0 ; i < 500 ; i++) { > > > > i > > > > try { > > Thread.sleep(500); > > } catch (Exception e) {} > > } > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org > > For additional commands, email: cocoon-dev-help@xml.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org > For additional commands, email: cocoon-dev-help@xml.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org > For additional commands, email: cocoon-dev-help@xml.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org