Author: dhanji
Date: Mon Mar 16 15:56:24 2009
New Revision: 905
Modified:
wiki/ServletRegexKeyMapping.wiki
Log:
Edited wiki page through web user interface.
Modified: wiki/ServletRegexKeyMapping.wiki
==============================================================================
--- wiki/ServletRegexKeyMapping.wiki (original)
+++ wiki/ServletRegexKeyMapping.wiki Mon Mar 16 15:56:24 2009
@@ -39,4 +39,21 @@
bind(Filter.class).annotatedWith(Fave.class).to(MyFilterImpl.class);
}}}
-See the [UserGuide User's Guide] for more information on binding and
annotations.
\ No newline at end of file
+See the [UserGuide User's Guide] for more information on binding and
annotations.
+
+= Injecting the injector =
+
+Once you have a servlet or filter injected for you using `ServletModule`,
you can access the injector at any time by simply injecting it directly
into any of your classes:
+
+{{{
+...@singleton
+public class MyServlet extends HttpServlet {
+ @Inject private Injector injector;
+ ...
+}
+
+// elsewhere in ServletModule
+serve("/myurl").with(MyServlet.class);
+}}}
+
+This is often useful for integrating third party frameworks that need to
use the injector themselves.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---