Status: New
Owner: ----

New issue 668 by [email protected]: Patch: DefaultGuiceServletContextListener
http://code.google.com/p/google-guice/issues/detail?id=668

I have the same exact GuiceServletContextListener in every web project I've ever worked on lately. Rather than continue to copy/paste the code into each new project I work on, I thought I should put it in a common library =)

My typical pattern is something along the lines of:
    Injector injector = Guice.createInjector(
        new ServletModule(),
        new Struts2GuicePluginModule(),
        new MyModule());
    Server server = injector.getInstance(Server.class);
    server.run();

With this setup it doesn't make sense to create the Injector in the GuiceServletContextListener. I think that design really only exists for running inside of application containers and not for embedded servers like Jetty, GSE, etc. Hopefully this file can be checked in and others running embedded servers find it helpful.

Attachments:
        DefaultGuiceServletContextListener.java  462 bytes

--
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