cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <>
Subject Re: L&F: passing parameters to resource (fwd)
Date Thu, 29 Nov 2001 13:36:19 GMT
On 29.Nov.2001 -- 02:11 PM, giacomo wrote:
> > On Wed, 28 Nov 2001, Christian Haul wrote:

[ on <map:redirect-to resource="" target=""/> ]

> > I agree, though, that @target is probably not as clean as possible. A
> > better solution would be, to introduce some construct to set those
> > variables without the need of an action, like
> >
> >   <map:variables>
> >      <map:parameter name="foo" value="xyz"/>
> >      <map:parameter name="bar" value="uvw"/>
> >   </map:variables>
> I'm not very happy with this. What is the reason to have those variables
> and how and why should they be used? I know if we block such a request

It has been requested from users for several times (at least twice) to
be able to set variables in sitemap without the need to use an action
that does nothing but set vars. 

The use case I see is that you'd like to set a parameter for some
processing step further down the pipeline because it depends on some
condition. But you don't want to modify an existing component to
expose additional vars or write a new component.

When using <map:resources/> it is valuable to be able to parameterise

In addition, the more I look at the @target attribute in
<map:redirect-to/>, the less I like it. It's more like a hack and
being able to set variables would be cleaner.

> someone will write a Matcher that spans everything that needs access to
> variables like
>    <map:match type="create-a-root-map">
>      <map:parameter name="bar" value="uvw"/>
>      <map:parameter name="foo" value="xyz"/>
>      <map:match pattern="foo">
>        <map:generate src="{../foo}/bar.xml"/>
>        ...
> This is IMO a misuse of the Matcher concept, but yes I'm sure someone will
> do it sometimes.

Yes, today this or an action is the only way to set vars. I agree,
this is not desirable nor beautiful.


C h r i s t i a n       H a u l
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

To unsubscribe, e-mail:
For additional commands, email:

View raw message