cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Coboos <cromo...@gmx.net>
Subject Re: Passing request parameters to resource/flowscript?
Date Tue, 02 Dec 2003 11:39:22 GMT
Ugo Cei wrote:

> Stephan Coboos wrote:
>
>> In the match section I'm calling the resource 'main' which is calling 
>> a flowscript function itself. But if I do that this way I don't have 
>> access to the request params within the flowscript! How do I activate 
>> passing request parameters thru resources to a flowscript?
>
>
> Did you try the following?
>
> function main() {
>
>   var x = cocoon.request.parameterName;
>
>   // or
>
>   var x = cocoon.request.getParameter("name");
>
> }


Yes, of course! Because if I don't redirect to a resource in the sitemap 
and call the function directly all works well. The "error" is very easy 
reproducable:

Simply change this pipeline ...

<map:match pattern="">
    <map:call function="myFunction"/>
</map:match>

... to this one ...

...
<map:resource name="myResource">
    <map:call function="myFunction"/>
</map:resource>
...
<map:match pattern="">
    <map:call resource="myResource"/>
</map:match>
...

In the first one cocoon.request... returns the request parameter 
correctly in the flowscript. In the second one, nothing will be returned.

What should I do?

Thank you.

Regards
Stephan


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message