On Sun, 16 Oct 2011 22:09:14 +0200, Julien Martin <bal...@gmail.com> wrote:
It might have to do with the way I contribute my Translator i.e.:
@Contribute(TranslatorSource.class)
public static void provideTranslators(MappedConfiguration<Class,
Translator> configuration) {
configuration.add(Postcode.class, new PostcodeTranslator());
}
See how I instanciate the PostcodeTranslator...
I don't know how to get round this...
If PostcodeTranslator is a defined service, you can use addInstance and
Tapestry will autobuild the service for you:
configuration.addInstance(Postcode.class, PostcodeTranslator.class);
otherwise you can inject its dependencies into the contribution method,
and pass to a constructor:
@Contribute(TranslatorSource.class)
public static void provideTranslators(MappedConfiguration<Class,
Translator> configuration, BignibouService service) {
configuration.add(Postcode.class, new PostcodeTranslator(service));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org