Hi David addComponentInstantiationListener(new SpringComponentInjector(this));
is correct, as there is no add() method in Application. Matt On 2010-03-11 15:14, David Chang wrote:
James, thanks for quick reply. I guess I am a little confused is that in the init method, I use addComponentInstantiationListener(new SpringComponentInjector(this)); instead of add(new SpringComponentInjector(this)); as "Migrating" guide specified. The Guide-specified approach actually generates compiler error. Regards. --- On Thu, 3/11/10, James Carman<jcar...@carmanconsulting.com> wrote:From: James Carman<jcar...@carmanconsulting.com> Subject: Re: A question about using Spring in Wicket 1.4 To: users@wicket.apache.org Date: Thursday, March 11, 2010, 9:09 AM yes On Thu, Mar 11, 2010 at 8:56 AM, David Chang<david_q_zh...@yahoo.com> wrote:Yesterday I was looking at the page "Migrating toWicket 1.4"http://cwiki.apache.org/WICKET/migrating-to-wicket-14.html Regarding SpringWebApplication, it says: SpringWebApplication has been deprecated in favor ofSpringBean annotation. See SpringWebApplication javadoc for how to setup SpringBean based injection.I went to Wicket API about SpringWebApplication and itsays:Deprecated. when using java5 it is preferrable to useSpringBean annotations for injection rather then this spring-specific application subclass with its helpers. To setup SpringBean add the following line to your WebApplication subclass init method add(new SpringComponentInjector(this));Here is my way of using Spring in my wicket app. 1. In the init method: addComponentInstantiationListener(newSpringComponentInjector(this));Please note that it is not: add(newSpringComponentInjector(this));2. In wicket components that access Spring beans: @SpringBean private SupportService supportService; Am I doing Spring in Wicket right way? Thanks for input!
smime.p7s
Description: S/MIME Cryptographic Signature