You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stephan Coboos <cr...@gmx.net> on 2005/01/09 13:08:54 UTC

Context scope available in cocoon?

Hello,

I have several config parms which I want to distribute via the context 
scope. Is in cocoon such a context scope available like in JSP/Servlets?

Thank you.

Regards
Stephan


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


Re: Context scope available in cocoon?

Posted by Stephan Coboos <cr...@gmx.net>.
>
>
> Hi Stephan,
>
> I'm using an Avalon component to set some config parameters in the 
> context. My component implements Contextualizable and Configurable. I 
> have a method like:
>
> public void contextualize(Context con) throws ContextException
> {
>    DefaultContext defCon = (DefaultContext)con;
>    this.context = 
> (HttpContext)defCon.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
> }
>
> then in the configure method I can do a context.setAttribute()
>
Works perfect. Thank you!

---
Stephan


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


Re: Context scope available in cocoon?

Posted by Adam Walsh <aw...@contal.net.au>.
Stephan Coboos wrote:

> Stephan Coboos wrote:
>
>> Hello,
>>
>> I have several config parms which I want to distribute via the 
>> context scope. Is in cocoon such a context scope available like in 
>> JSP/Servlets?
>
> Ahh, as I saw, only the avalon context has no setAttribute aso. The 
> cocoon context instead has already such methods. But how to access the 
> cocoon context within a avalon component?


Hi Stephan,

I'm using an Avalon component to set some config parameters in the 
context. My component implements Contextualizable and Configurable. I 
have a method like:

public void contextualize(Context con) throws ContextException
{
    DefaultContext defCon = (DefaultContext)con;
    this.context = 
(HttpContext)defCon.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
}

then in the configure method I can do a context.setAttribute()

HTH,
Adam

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


Re: Context scope available in cocoon?

Posted by Stephan Coboos <cr...@gmx.net>.
Stephan Coboos wrote:

> Hello,
>
> I have several config parms which I want to distribute via the context 
> scope. Is in cocoon such a context scope available like in JSP/Servlets?
>
> Thank you.
>
> Regards
> Stephan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
Ahh, as I saw, only the avalon context has no setAttribute aso. The 
cocoon context instead has already such methods. But how to access the 
cocoon context within a avalon component?

Thanks.

Regards
Stephan


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