You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Bardo Nelgen <ma...@bnnperformances.de> on 2006/09/21 14:17:28 UTC

Accessing Sessions

Hi all,

how can I obtain a list of

a) the current session-id of the current context (hopefully named that 
right...)
b) all currently active sessions

from Cocoon via

1. FlowScript
2. inside a generator
3. inside an action

???

Any help highly appreciated.

Bardo Nelgen

-- 
---

 BNN Performances

 http://www.wewillwebyou.com/


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


Re: Accessing Sessions

Posted by Bardo Nelgen <ma...@bnnperformances.de>.
Any further ideas on the other aspects, anyone ???



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


Re: Accessing Sessions

Posted by Bardo Nelgen <ma...@bnnperformances.de>.
Thanks !

Bardo


-- 
---

 BNN Performances

 http://www.wewillwebyou.com/


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


Re: Accessing Sessions

Posted by Bardo Nelgen <ma...@bnnperformances.de>.
Thanks, Andrew.  Yes, maybe something like that.

Bardo

Andrew Stevens wrote:
>> From: Jason Johnston <co...@lojjic.net>
>> Reply-To: users@cocoon.apache.org
>> To: users@cocoon.apache.org
>> Subject: Re: Accessing Sessions
>> Date: Thu, 21 Sep 2006 07:15:27 -0600
>>
>> Bardo Nelgen wrote:
>>>
>>> Hi all,
>>>
>>> how can I obtain a list of
>>>
>>> a) the current session-id of the current context (hopefully named 
>>> that right...)
>>> b) all currently active sessions
>>>
>>> from Cocoon via
>>>
>>> 1. FlowScript
>>> 2. inside a generator
>>> 3. inside an action
>>>
>>
>> I can answer for a) ... I'm not sure if b) is possible but hopefully 
>> others will chime in.
>
> Well, HttpSessionContext contains a getIds() method, but that's been 
> deprecated since servlet 2.1.  Also, I don't think Cocoon's own 
> Session interface contains a getSessionContext() method anyway.
> I guess the more up to date method would be to create a 
> HttpSessionListener that tracks the IDs being created/destroyed and 
> lets you query the current list.  You could then call that from the 
> Cocoon components as required (you'll need the list & query method to 
> be static, and watch out for threading issues).
>
>
> Andrew.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

-- 
---

 BNN Performances

 http://www.wewillwebyou.com/


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


Re: Accessing Sessions

Posted by Andrew Stevens <at...@hotmail.com>.
>From: Jason Johnston <co...@lojjic.net>
>Reply-To: users@cocoon.apache.org
>To: users@cocoon.apache.org
>Subject: Re: Accessing Sessions
>Date: Thu, 21 Sep 2006 07:15:27 -0600
>
>Bardo Nelgen wrote:
>>
>>Hi all,
>>
>>how can I obtain a list of
>>
>>a) the current session-id of the current context (hopefully named that 
>>right...)
>>b) all currently active sessions
>>
>>from Cocoon via
>>
>>1. FlowScript
>>2. inside a generator
>>3. inside an action
>>
>
>I can answer for a) ... I'm not sure if b) is possible but hopefully others 
>will chime in.

Well, HttpSessionContext contains a getIds() method, but that's been 
deprecated since servlet 2.1.  Also, I don't think Cocoon's own Session 
interface contains a getSessionContext() method anyway.
I guess the more up to date method would be to create a HttpSessionListener 
that tracks the IDs being created/destroyed and lets you query the current 
list.  You could then call that from the Cocoon components as required 
(you'll need the list & query method to be static, and watch out for 
threading issues).


Andrew.



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


Re: Accessing Sessions

Posted by Jason Johnston <co...@lojjic.net>.
Bardo Nelgen wrote:
> 
> Hi all,
> 
> how can I obtain a list of
> 
> a) the current session-id of the current context (hopefully named that 
> right...)
> b) all currently active sessions
> 
> from Cocoon via
> 
> 1. FlowScript
> 2. inside a generator
> 3. inside an action
> 

I can answer for a) ... I'm not sure if b) is possible but hopefully 
others will chime in.

1. Flowscript

   cocoon.session.getId();

2. inside a generator

   public void setup(SourceResolver resolver, Map objectModel,
                     String src, Parameters par)
              throws ProcessingException, SAXException, IOException {		
     ObjectModelHelper.getRequest(objectModel).getSession().getId();
   }

3. inside an action
   (same as 2. except in the act() method rather than setup().)


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