On Fri, 2003-01-31 at 16:01, Lionel Crine wrote:
> Hello,
> 
> I' d like to get two session variables and use them as parameter for my 
> custom generator.
> 
> 1/Should I get them in the sitemap and use <map:parameter ?> in the sitemap.
> how do I write that ?
<map:generator ...>
    <map:parameter name="var1" value="{session-attr:var1}"/>
    <map:parameter name="var2" value="{session-attr:var2}"/>
</map:generator>

This will create parameters named var1 && var2 respectively using the
session attributes var1 && var2
The {session-attr:} is an input module.

> 
> 2/Or should I get them direclty in the generator ?
> How do I do that ?
I don't know if one is necessarily better than the other but to do this
would be done as follows, inside the act method.

Request request = ObjectModelHelper.getRequest(objectModel);
String var1 = (String) request.getSession().getAttribute("var1");

> 
> 
> Lionel
> 
Hope this helps

> 
>   
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
-- 
Andrew Timberlake <[EMAIL PROTECTED]>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to