SpringWebApplication subclass's
init() method.
How to handle this? (I am not using Spring).
Thanks, Chris
-Ursprüngliche Nachricht-
Von: Martin Grigorov [mailto:mcgreg...@e-card.bg]
Gesendet: Samstag, 01. Mai 2010 18:16
An: users@wicket.apache.org
Betreff: Re: @Inject (Guice) with non components
-
Von: Martin Grigorov [mailto:mcgreg...@e-card.bg]
Gesendet: Samstag, 01. Mai 2010 18:16
An: users@wicket.apache.org
Betreff: Re: @Inject (Guice) with non components (i.e. DataProvider)
public MyDataProvider() {
InjectorHolder.getInjector().inject(this);
}
is the way in 1.4.8 which
, 01. Mai 2010 18:16
An: users@wicket.apache.org
Betreff: Re: @Inject (Guice) with non components (i.e. DataProvider)
public MyDataProvider() {
InjectorHolder.getInjector().inject(this);
}
is the way in 1.4.8 which will be released these days.
Until then you'll have to use
It there a good solution for using @Inject on non components, i.e. a
DataProvider.
For instance I have a DataProvider that does not use the default constructor so
it cannot be injected into the page.
But the DataProvider will use a DAO and it would be nice to inject the DAO
rather than having
public MyDataProvider() {
InjectorHolder.getInjector().inject(this);
}
is the way in 1.4.8 which will be released these days.
Until then you'll have to use
public class MyInjector {
public static void inject(Object target) {
GuiceInjectorHolder guiceInjectorHolder =
Just to make sure I understand...
Will this work? Even if the page and thus MyDataProvider gets serialized?
public MyDataProvider implements IDataProvider{
@Inject MyDAO myDAO;
public MyDataProvider() {
InjectorHolder.getInjector().inject(this);
}
}
On
It will work in 1.4.8/1.4.x-SNAPSHOT
In 1.5-SNAPSHOT substitute with: InjectorHolder.get().inject(this)
On Sat, 2010-05-01 at 13:57 -0700, Douglas Ferguson wrote:
Just to make sure I understand...
Will this work? Even if the page and thus MyDataProvider gets serialized?
public