cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: [C2]: Problems with Actions and Parameters
Date Wed, 28 Feb 2001 15:16:23 GMT
Carsten Ziegeler wrote:
> 
> Hi,
> 
> when I use action and parameters in this way:
> 
>    <map:match pattern="forms/employee">
>      <map:act set="employee">
>          <parameter name="hallo" value="value"/>
> 
>          <map:generate type="serverpages" src="docs/samples/forms/employee.xsp"/>
>          <map:transform src="stylesheets/dynamic-page2html.xsl"/>
>          <map:serialize/>
>      </map:act>
>    </map:match>

Unless you are using objectMap variables, this is not necessary anyways.

> the generated java code is not compilable:
> 
>   param = new Parameters ();
>   param.setParameter ("hallo", substitute(listOfMaps, "value"));
> 
>   if ((map = action_set_employee (cocoon_action, listOfMaps,
>                                         environment, objectModel,
>                                         substitute(listOfMaps, null), param)) != null)
{
>      getLogger().debug("Action action_set_employee");
>      listOfMaps.add (map);
> 
>     .setParameter ("hallo", substitute(listOfMaps, "value"));

That is a problem.  This is probably a side affect of the change I made to key the
param value off of an xsl:param.  I can change the code so that if the parameter
is not set, then it won't output the call anyway.

> The parameter is processed twice! If the map:generate etc. is used outside the map:act
the generated code is ok:
>      <map:act set="employee">
>          <parameter name="hallo" value="value"/>
>      </map:act>
>      <map:generate type="serverpages" src="docs/samples/forms/employee.xsp"/>
>      <map:transform src="stylesheets/dynamic-page2html.xsl"/>
>      <map:serialize/>
> 
> I search through the sitemap.xsl for the reason but I think it will take me some days
to find the problem.

Is it being called instead of applied?  Let me apply my change, and it will get rid of _any_
instance where
the parameter is not set.

Mime
View raw message