Thank you bklough,
I am attempting to do this with a simple logger, so far, in my
servlets, I call:
@Inject
private static org.slf4j.Logger log;
The injection is set up in MyLoggerModule as follows (which is in the
createInjector call with ServletModule) :
@Override
public void configure() {
bindListener(Matchers.any(), new SLF4JTypeListener()); // I
built my own SLF4JTypeListener...
}
This all works perfectly in the servlets, but the field injection does
not work when called by a class that is not a servlet or filter.
What am I missing? It seems like I might be missing something in the
configuration, as in I might be doing something wrong where
you said to "Create a Guice Module ("MyModule") that configures those
non-servlet classes
that you would like to use Guice with". Can you see what I am doing
wrong (or missing completely?)
Thanks for the help again.
--
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.