Yup. That does the ticket!
Here's the code if anyone's interested...
The listener...
package com.inexas.test.server;
import javax.servlet.*;
public class AppStarter implements ServletContextListener {
public void contextInitialized(ServletContextEvent event) {
ServletContext sc = event.getServletContext();
System.out.println(sc.getServerInfo()) ;
}
public void contextDestroyed(ServletContextEvent event) {
System.out.println("Bye!");
}
}
In the web.xml file...
<web-app>
<listener>
<listener-class>
com.inexas.test.server.AppStarter
</listener-class>
</listener>
...
On Jun 11, 2009, at 11:21 AM, Jason Morris wrote:
> Personally I would say use a ServletContextListener if the
> structures you are creating will be
> shared by several of your Servlets. That way the init is finished
> before any of your Servlets are
> created.
>
> Load-on-startup always feels like a bit of a hack to me ;)
>
> Just my 2c
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---