Comment #3 on issue 603 by gianmarco.gherardi: GuiceServletContextListener.getInjector should have one param: servletContext
http://code.google.com/p/google-guice/issues/detail?id=603

Yes, this is what i currently do, but this is just a workaround to me, not very elegant:

public class AppGuiceServletContextListener extends GuiceServletContextListener {
        private ServletContext servletContext;

        @Override
        public void contextInitialized(ServletContextEvent servletContextEvent) 
{
                servletContext = servletContextEvent.getServletContext();
                super.contextInitialized(servletContextEvent);
        }

        @Override
        protected Injector getInjector() {
Integer applicationId = Integer.valueOf(servletContext.getInitParameter("applicationId"));
                return Guice.createInjector(new AppModule(applicationId));
        }
}

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" 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-guice-dev?hl=en.

Reply via email to