In most of Guice examples in documentation,
Guice is used in basic "public static void main"

I came across some code samples on how to configure Guice in Servlet
environment [1].
still I have questions which hope you can help me with.

I would like to know what happens to the injector
that is being returned from getInjector() method as you can see below.
my main question is the workflow.

- at what point this getInjector is being called, and where does the
returned injector go ?
if we do not explicitly retrieve instances from injector, then what is
the point of returning an injector ?
and other question

- what happens if we don't return any injector, and just use
Guice.createInjector ?
for example, having a void init() method, which calls
Guice.createInjector , but does not return anything ?

public class MyGuiceServletConfig extends GuiceServletContextListener
{

  @Override
  protected Injector getInjector() {
    return Guice.createInjector(new ServletModule());
  }
}




[1]http://code.google.com/p/google-guice/wiki/ServletModule

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