factor out an init method that both constructors call. -igor
On Sat, Feb 28, 2009 at 11:14 AM, Christian Helmbold <christian.helmb...@yahoo.de> wrote: > Hi Martjin, > > it is not possible to compile the code without static. Without static I get > the compiler error: "cannot reference repository before supertype constructor > has been called". But I cannot write > public ArticlePage() > { > super(); > this(); > } > because each of them must be the first statement in the constructor. And I > cannot inject the reference directly into the constructor because of the > mentioned restriction of Wickets Spring integration (no constructor > injection). > > The only way out of this dilemma seems to be not to inject the repository. > But if I cannot use injected reference within constructors I don't know why I > should use Dependency Injection (DI). The constructors are very important in > most classes of Wicket applications. I could use the the service locator > pattern with it's pros and cons. But I hope there is a solution with DI ... > > Regards > Christian > > -- > http://www.groovy-forum.de > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org