users@glassfish.java.net

Re: ContextListener

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Fri, 05 Sep 2008 09:04:12 -0700

On 09/ 5/08 02:12 AM, glassfish_at_javadesktop.org wrote:
> Hello,
>
> I have a contextlistener doing some initialization and processing in my application.
>
> It is like:
>
> public class ContextListener implements ServletContextListener {
> public void contextInitialized(ServletContextEvent event) { ..
> public void contextDestroyed(ServletContextEvent event) { ..
> }
>
> Here is an interesting thing. I tried making another virtual domain to host another application, and my context listener would initialize twice when there is another app hosted in another virtual domain.
>

If you deploy your webapp to a number of virtual servers, the web
container will create as many
representations of your webapp: one per virtual server.

Therefore, your context listener will also be invoked as many times.

Jan


> why?
>
> Best.
> [Message sent by forum member 'segfault2007' (segfault2007)]
>
> http://forums.java.net/jive/thread.jspa?messageID=297401
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>