The servlet context can be obtained from the session, which in turn can be
obtained from the event being passed in to the listener. The listener does
indeed have to be thread safe - the good news is that the ServletContext is,
by definition, thread safe as well. As to whether you store the
ServletContext as a member variable on the listener or extract it from each
event coming in, that all depends on the specifics of your design.

Mike

On 1/16/07, maskkkk <[EMAIL PROTECTED]> wrote:


I don't understand where the servletContext comes from,
(I'm under the assumption that that the Listener has to be
thread-safe/that
the servletContext should not be stored in a member variable)

Thanks again,
  Andrew J. Leer


Matt Raible-3 wrote:
>
> If you put the listener after the StartupListener (or
> ContextLoaderListener in 2.0), you should be able to add/load Spring's
> ApplicationContext using:
>
>         ApplicationContext ctx =
>
> WebApplicationContextUtils.getRequiredWebApplicationContext
(servletContext);
>
> HTH,
>
> Matt
>
> On 1/15/07, maskkkk <[EMAIL PROTECTED]> wrote:
>>
>> Is it "possible to"/"should I be" accessing a Manager in the service
>> layer
>> inside a HttpSessionListener that loads the User's properties into the
>> session when they log in?
>>
>> Thank you,
>>   Andrew J. Leer
>>
>>
>> --
>> View this message in context:
>>
http://www.nabble.com/Accessing-a-Manager-in-HttpSessionListener--tf3017281s2369.html#a8379456
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> http://raibledesigns.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

--
View this message in context:
http://www.nabble.com/Accessing-a-Manager-in-HttpSessionListener--tf3017281s2369.html#a8389490
Sent from the AppFuse - User mailing list archive at Nabble.com.

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


Reply via email to