cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <Ralph.Go...@dslextreme.com>
Subject Re: AW: How to connect Avalon Component and SessionListener
Date Mon, 12 Dec 2005 15:27:07 GMT


Ralph Goers wrote:

>
>
> Stefan Pietschmann wrote:
>
>> Yes, I read about that and tried to find out a bit more about
>> HTTPSessionBindingListener. However I don't quite get the "store your
>> component as a session attribute"-part.
>> 1. I'm using my component in the pipline implementation. I assume 
>> you'd do
>> it some way like this (made it short):
>>
>> ObjectModelHelper.getRequest(environment.getObjectModel()).getSession().setA 
>>
>> ttribute("mycomponent",component);
>>  
>>
>
> I call this method during login - it is in the SessionData class

I should be clearer. This code assumes that login is single threaded so 
synchronization is not necessary.

>
>    public static SessionData getInstance(Session session)
>    {
>        SessionData sessionData = (SessionData) 
> session.getAttribute(SESSION_DATA);
>
>        if (sessionData == null)
>        {
>            sessionData = new SessionData();
>            session.setAttribute(SESSION_DATA, sessionData);
>        }
>        return sessionData;
>    }
>
>

Mime
View raw message