|
Guice
Guice integration module makes objects assembled with Google Guice module(-s) transparently availaible in Tapestry. UsageTo start using your guice-assembled objects just add goodies-guice JAR to classpath and configure GuiceObjectProvider in your Tapestry module: public static void contributeGuiceObjectProvider(Configuration<Module> configuration) {
configuration.add(new MyModule());
}When configured Guice module bindings are available to Tapestry via @Inject annotation: public class Login {
@Inject
private GuiceConfiguredService myService;
}Note that only explicitly bound objects are available to Tapestry. public MyModule extends AbstractModule {
protected configure() {
bind(MyGuiceService.class); // this makes MyGuiceService visible to Tapestry
}
}
|
► Sign in to add a comment