You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stefano Mazzocchi <st...@apache.org> on 2001/02/08 12:28:56 UTC

Re: Seminar subject Cocoon (fwd)

Donald Ball wrote:
> 
> just in case you want / have time to answer him

sure
 
> ---------- Forwarded message ----------
> Date: Wed, 7 Feb 2001 19:54:24 +0000 (UTC)
> From: Forge <fo...@neonics.com>
> Reply-To: cocoon-users@xml.apache.org
> To: cocoon-users@xml.apache.org
> Subject: Seminar subject Cocoon
> 
> Hi there,
> 
> Tomorrow the university I go to organises a student seminar.
> My lecture is about Cocoon.
> 
> There is something that is not completely clear to me, and I expect
> questions about it:
> 
> Excerpt from Stefano's slides:
> 
> The problems with JSP:
> - logic has direct access to the output
> - output is always streamed
> 
> Our solution: XSP
> - logic as _not_ direct access to the output
> - output is _never_ streamed
> 
> I think that xsp has direct access to output: you can insert XML tags
> into the stream.

The key word is "direct" not "output".

> You also have access to the servlet HttpResult object.
> If you ignore the last remark, you could say that xsp does not have
> direct access to the _final_ output stream, but rather to its own output
> stream (it HAS to have that, right?)

Correct.
 
> Then by output we mean the final stream.
> Why is output _never_ streamed? The final output stream is most certainly
> streamed to the web-client (maybe even through the webserver?)

The output is *never* streamed by the XSP page, but by some other Cocoon
component down the pipeline. Unlike JSP which do not have this
distinction.

Why is it important? well, it allows you to postprocess XSP output,
unlike JSP. (Note: you can do that with filters in Servlet 2.3, but
isn't as fast since filters have to reparse the stream and reselialize
it every time).
 
> If the above means that the output of an xsp page is a DOM tree structure,
> than I can understand it, but in Cocoon2 the output IS streamed into
> SAX events..

"Stream" in that content represents "characters streams". 
 
> So if the above does no longer hold for Cocoon 2, I need to strip them..

No, it does, you have to indicate what terminology you are using.

> That means that there are only two points in favor of XSP to JSP,
> namely the 'abstraction of programming language' and 'abstraction
> of output', although the latter could be accomplished with JSP..

No, it cannot, unless you are willing to pay the price of
parsing-serialization on the char stream for each servlet filter, or you
recreate a sort-of-output-abstraction inside the JSP page and you
replicate it along with all your JSPs (ending up in a bastardized
Cocoon-clone, anyway)

Hope this helps.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------