cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject RE: generator based including
Date Thu, 11 Jan 2001 18:26:30 GMT
"Torsten Curdt" <tcurdt@dff.st> wrote:
> > > <util:include-xsp uri="file:///something/included.xml"/>
> > >
> > > Works quite well - as soon as the class representation
> > > of "included.xml" is generated.

> > > Can anyone think of a way to generate it automatically?
> > > Also changes in "included.xml" need to be recognized.

Those are exactly what the roles of XSPGenerator are supposed to be, no? 
Compiling and dependency tracking.

> > Is this for Cocoon 2?
>
>Yes!
>
> > What is the problem you are trying to solve?  Hopefully
> > we can come up with the elegant solution...
>
>I hope so as well! I want to be able to include a XSP page
>into another one.

I have changed my mind on this. I don't like it so much. Here's why.

I only became aware recently of the Servlet 2.2 spec's support for 
subrequests (including), due to a bug report on cocoon-users. In my opinion 
this support is very confusing and seems to be a bit arbitrary. This affects 
XSP including because XSP including is similar - people undoubtedly will 
want the facility to pass parameters to included pages.

According to the servlet 2.2 spec, if you ask for the request parameters you 
get the parent request AND the subrequest parameters. However if you ask for 
the query string you only get the parent request's parameters. Likewise, if 
you ask for one kind of path, you get the parent requests' path, whereas 
another kind of path gives you the subrequests' path. It is not intuitively 
obvious what's going to happen when you make a ServletRequest call from a 
subrequest - and it's even worse in Cocoon 1 which has to support pre-2.2 
engines.

This stems from the fact that the ServletRequest API was apparently not 
originally designed with subrequests in mind. Thus it is messy.

So, why can't you just use good old logicsheets? Why invent a new way when 
logicsheets work fine?

Admittedly, my criticisms also apply to content aggregation - which we do 
need explicit support for, I agree.

Okay, on second thoughts, maybe what we should say is, all "internal Cocoon 
requests" (whether it's content aggregation or Torsten's XSP including) 
don't follow the Servlet spec model and don't inherit anything from their 
parent requests, unless it is explicitly passed through as a parameter. That 
would avoid the confusion.

But I'm still not convinced that XSP including is sufficiently useful. Could 
we have a more concrete, detailed example of how it is better than 
logicsheets?



_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


Mime
View raw message