On Wed, May 19, 2010 at 11:02 AM, senny <[email protected]> wrote:

> Is it possible to use two ServletModules in combination with child
> Injectors?


No it is not, unfortunately. With the new patch in trunk you can create
multiple Guice filters, however the servlet context is still shared so you
end up with a corrupt state if you use it at all (we had another internal
need for multiple Guice filters). If you can live with that problem (i.e.
NEVER inject ServletContext in your app) then that may be a quick solution.

It is definitely my plan to fully support multiple servlet modules however.


> And where should I create the "Root Injector"? I am
> currently creating the Injectors in a ServletContextListener.
>

Instead, I would share it via a different system like JNDI (which we support
via an extension). You can't even rely on a static variable since
classloader isolation would play spoil sport.

Dhanji.

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

Reply via email to