public abstract class GuiceServletContextListener extends Object implements ServletContextListener
GuiceServletContextListener
class as a logical place to create and configure your injector. This will ensure the injector
is created when the web application is deployed.Constructor and Description |
---|
GuiceServletContextListener() |
Modifier and Type | Method and Description |
---|---|
void |
contextDestroyed(ServletContextEvent servletContextEvent) |
void |
contextInitialized(ServletContextEvent servletContextEvent) |
protected abstract Injector |
getInjector()
Override this method to create (or otherwise obtain a reference to) your
injector.
|
public void contextInitialized(ServletContextEvent servletContextEvent)
contextInitialized
in interface ServletContextListener
public void contextDestroyed(ServletContextEvent servletContextEvent)
contextDestroyed
in interface ServletContextListener
protected abstract Injector getInjector()