Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Guice for Dropwizard
@Override
public ServletContainer getJerseyContainer(DropwizardResourceConfig resourceConfig,
MyServiceConfig serviceConfig) {
// I like having a root module, but you can use as many as you like
final Injector injector = Guice.createInjector(new MyServiceModule(serviceConfig));
return new GuiceContainer(injector) {
@Override
public ResourceConfig getDefaultResourceConfig(Map<String,Object> props, WebConfig webConfig) {
return resourceConfig;
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment