> -----Oorspronkelijk bericht-----
> Van: Leszek Gawron [mailto:[EMAIL PROTECTED]]
> Verzonden: zaterdag 13 juli 2002 16:20
> Aan: [EMAIL PROTECTED]
> Onderwerp: Re: Cocoon as an application server
>
>
> On Sat, Jul 13, 2002 at 02:43:41PM +0200, Koen Pellegrims wrote:
> > Don't cling too much to the fact that you are using a PocketPC. If your
> > application sends data as an HTTP request, your server can
> handle it easily;
> > you could develop the entire server-side application using a
> normal browser
> > as a client and then switch over to the PocketPC...
> This was my first idea .. the application's got to be quick and I
> need to do
> some client side data caching
>
> >
> > To answer you last question: the StreamGenerator generates XML
> data from an
> > incoming stream, who's length is not fixed. You won't be
> needing this, as
> I think that for stream that length IS fixed
> from cocoon docs:
> For POST requests with mimetypes: text/plain, text/xml,
> application/xml the
> xml data is in the body of the POST request and its length is
> specified by the
> value returned by getContentLength() method.

Sorry, my bad. The length is fixed, but not known in advance. The length is
calculated once the stream encounters two newlines at the end of the HTTP
message. This means the parser cannot ask the stream how much data it
contains, because there might be more data on the way. That is why the
stream gets help from the PostInputStream. If the parser asks if there is
any more data available, the PostInputStream will check if the amount of
data that has been read is less than what the Content-length header
specified...

You should read the second example on the StreamGenerator-page (the one with
the Telnet scenario). This is a more accurate depiction of what the
StreamGenerator does, the first example is not a "real" StreamGenerator
use-case...

The StreamGenerator is useful in cases where the client does not know how
much data will be generated in advance (that is: when it cannot generate a
Content-length-header).

>       ouzo
> --
>             __
>          | /  \ |        Leszek Gawron            //  \\
>         \_\\  //_/      [EMAIL PROTECTED]          _\\()//_
>          .'/()\'.     Phone: +48(600)341118     / //  \\ \
>           \\  //  recursive: adj; see recursive  | \__/ |
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to