cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <>
Subject Re: extending ProducerFromFile functionality
Date Thu, 26 Oct 2000 12:57:56 GMT
Chris Meyer <> wrote:
>I'm looking for a way to 'produce' a different template file based on
>the request parameters.

In most cases, including this one, anything a Producer can do, XSP can do 
better. :)

>For instance, let's say I'm trying to protect a document by requiring
>the user to log in first.
>The user may request something like 
>I can check to see whether they've logged in and then 'redirect' them
>to a login page if they haven't. But this isn't a wholly satisfying
>solution for many reasons.

Such as? At least you can cache your login page this way. If your login page 
is not a separate URL it can't be cached (in C1).

>What I think it would be ideal is if I could process the request and
>'produce' a template file based on the request parameters... If they
>were logged in, it would 'produce' the file 'protected.html';
>otherwise it might 'produce' the file 'pleaselogin.html'.
>The STRUTS framework, at its most basic level, does just this. It
>seems like it would be a nice addition to Cocoon and allow processing
>of Actions...
>MY QUESTIONS: should I write a custom producer to do this?

No, use a redirect or XSP.

>is this
>something that others could use? is this what Cocoon 2 already does?

Yes. The sitemap is ideal for this.

Get Your Private, Free E-mail from MSN Hotmail at

Share information about yourself, create your own public profile at

View raw message