@Inject (Guice) with non components (i.e. DataProvider) injectorHolder has not been assigned

2010-05-21 Thread Christoph Grün
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

Re: @Inject (Guice) with non components (i.e. DataProvider) injectorHolder has not been assigned

2010-05-21 Thread nino martinez wael
- 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

Re: @Inject (Guice) with non components (i.e. DataProvider) injectorHolder has not been assigned

2010-05-21 Thread Jeremy Thomerson
, 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

@Inject (Guice) with non components (i.e. DataProvider)

2010-05-01 Thread Douglas Ferguson
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

Re: @Inject (Guice) with non components (i.e. DataProvider)

2010-05-01 Thread Martin Grigorov
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 =

Re: @Inject (Guice) with non components (i.e. DataProvider)

2010-05-01 Thread Douglas Ferguson
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

Re: @Inject (Guice) with non components (i.e. DataProvider)

2010-05-01 Thread Martin Grigorov
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