Eelco Hillenius wrote:
>> I just wanted to share another way of injecting spring services into
>> wicket code. This one uses AOP.
>>
>>             - o - Why another approach? - o -
>>
>> Using wicket-spring along with wicket-spring-annot works nicely for
>> components (althought you have to remember not initializing it  
>> yourself)
>> but does not work for other parts of application - models. Just ask  
>> your
>> self how many times you have put a spring service into wicket page  
>> only
>> to pass it to model constructed:
> 
> 
> Thanks for the contribution. It's always good to know multiple ways  
> of doing this. However, in this case I was wondering whether you  
> tried this?
> 
> public class SomeModel extends SomeOtherModel {
> 
>    @SpringBean MyService service;
> 
>    public SomeModel() {
>      InjectorHolder.getInjector().inject(this);
>    }
> }

yep .. didn't work. Only Components get the dependencies injected.

-- 
Leszek Gawron

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to