I'm posting this again (my first post got lost).
I'm trying to configure my ServletModule using Names.bindProperties()
doing the following:
public class FooModule extends ServletModule {
@Inject @Named("data.source") private String dataSource;
protected void configureServlets() {
Names.bindProperties(binder(), loadProperties());
requestInjection(this);
bind(Context.class).to(InitialContext.class);
bind(DataSource.class)
.toProvider(fromJndi(DataSource.class, dataSource));
}
}
I thought the requestInjection(this) would load the property
"data.source"
into dataSource but no, the dataSource remains null.
What is the best way to have the properties available in each module?
I'm using guice trunk (r1275)
Thank you
--
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.