Or how about a simple solution:
public MyApplication extends WebApplication {
public Object lookup(String name) {
Object=...do a lookup from somewhere like spring context or app object...;
return object;
}
}
public MyPage extends Page {
public transient SomeService service;
public SomeService getService() {
if (service==null) {
service=getApplication().lookup(SomeService.class.getName());
}
return service;
}
I know its not quiete as elegant as ioc but it has none of the
performance hits an automatic injection would cause if it would be done
on deserialization of every component. Also its a lazy lookup so you
dont do it until its needed, and its only done once per page (until it
gets deserialized).
-Igor
- RE: [Wicket-user] My take on Spring integration Igor Vaynberg
- Re: [Wicket-user] My take on Spring integration Christian Essl
- Re: [Wicket-user] My take on Spring integration Alexandru Popescu
- Re: [Wicket-user] My take on Spring integration Eelco Hillenius
- Re: [Wicket-user] My take on Spring integra... Christian Essl
- Re: [Wicket-user] My take on Spring int... Eduardo Rocha
- Re: [Wicket-user] My take on Sprin... Eduardo Rocha
- Re: [Wicket-user] My take on Sprin... Alexandru Popescu
- Re: [Wicket-user] My take on S... Eduardo Rocha
- Re: [Wicket-user] My take ... Igor Vaynberg
- Re: [Wicket-user] My take ... Alexandru Popescu
- Re: [Wicket-user] My take ... Igor Vaynberg
- Re: [Wicket-user] My take ... Eelco Hillenius
- Re: [Wicket-user] My take ... Alexandru Popescu
- Re: [Wicket-user] My take ... Eduardo Rocha
- Re: Re: [Wicket-user] My take on Spring integration Gustavo Hexsel
- Re: Re: [Wicket-user] My take on Spring integra... Igor Vaynberg
