-
Patch
-
Resolution: Obsolete
-
Major
-
None
-
1.2.1.GA
The GuiceResteasyBootstrapServletContextListener creates modules and Guice injector that is used to initialize resources. The injector is then left for garbage collection.
There are situations when you would like to use a single instance of a Guice module throughout your application. For example another ServletContextListener needs to do some initialization of guice managed objects. Or the guice managed objects are needed in a servlet.
The very simple attached patch modifies the GuiceResteasyBootstrapServletContextListener in a way that the Injector is placed to the ServletContext. This is very similar to a way how GuiceServletContextListener (http://code.google.com/p/google-guice/source/browse/tags/2.0/servlet/src/com/google/inject/servlet/GuiceServletContextListener.java) does this. Therefore someone can use the GuiceFilter if he needs it etc.
The patch also includes a test case.