You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Carlos Duque <cd...@eic.es> on 2004/07/20 15:02:57 UTC
Parameters between Action and XSP
Hello, I'm developing a application under cocoon. My question is to mark a "best practices" in my work.
How I pass parameters between Action and XSP? Which are the best option?
I know:
-session
-request.setParameter
It's possible with Map returned? with response?
Thank's for all!!
Carles
Re: Parameters between Action and XSP
Posted by Andreas Hartmann <an...@apache.org>.
Carlos Duque wrote:
> Hello, I'm developing a application under cocoon. My question is to mark
> a "best practices" in my work.
> How I pass parameters between Action and XSP? Which are the best option?
> I know:
> -session
> -request.setParameter
> It's possible with Map returned? with response?
I would recommend the following:
public Map act(...) {
...
Map result = new HashMap();
result.put("foo", value);
return result;
}
<map:act type="...">
<map:generate type="xsp" src="...">
<map:parameter name="foo" value="{foo}"/>
</map:generate>
</map:act>
XSP: String foo = parameters.getParameter(foo);
This way you have a separation between parameter names in action
and XSP and see what happens in the sitemap.
-- Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org