Skip to content

Instantly share code, notes, and snippets.

@christophercurrie
Created October 5, 2012 19:32
Show Gist options
  • Save christophercurrie/3841860 to your computer and use it in GitHub Desktop.
Save christophercurrie/3841860 to your computer and use it in GitHub Desktop.
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;
}
};
}
@cemo
Copy link

cemo commented Oct 5, 2012

Nice :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment