Hi there,
I want to inject the servletContext within my module to bind the
realpath param to a named object:
public class ServiceModule extends AbstractModule {
protected void configure() {
bind(String.class).annotatedWith(Names.named("realPath")).toInstance(servletContext.getRealPath("/
temp"));
}
}
Before I injected the servletcontext into one of my services but Guice
is throwing now a lot of warnings which say that this is not a good
idea.
How can I achieve this?
Thanks
--
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.