You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by David Chang <da...@yahoo.com> on 2010/03/11 14:56:42 UTC
A question about using Spring in Wicket 1.4
Yesterday I was looking at the page "Migrating to Wicket 1.4"
http://cwiki.apache.org/WICKET/migrating-to-wicket-14.html
Regarding SpringWebApplication, it says:
SpringWebApplication has been deprecated in favor of SpringBean annotation. See SpringWebApplication javadoc for how to setup SpringBean based injection.
I went to Wicket API about SpringWebApplication and it says:
Deprecated. when using java5 it is preferrable to use SpringBean 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(new SpringComponentInjector(this));
Please note that it is not: add(new SpringComponentInjector(this));
2. In wicket components that access Spring beans:
@SpringBean
private SupportService supportService;
Am I doing Spring in Wicket right way?
Thanks for input!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: A question about using Spring in Wicket 1.4
Posted by Gwyn Evans <gw...@gmail.com>.
Fixed the Javadoc in 1.4.x & trunk. Thanks for reporting.
/Gwyn
On 11 March 2010 14:14, David Chang <da...@yahoo.com> 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 <jc...@carmanconsulting.com> wrote:
>
> > From: James Carman <jc...@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 <da...@yahoo.com>
> > wrote:
> > > Yesterday I was looking at the page "Migrating to
> > Wicket 1.4"
> > >
> > > http://cwiki.apache.org/WICKET/migrating-to-wicket-14.html
> > >
> > > Regarding SpringWebApplication, it says:
> > >
> > > SpringWebApplication has been deprecated in favor of
> > SpringBean annotation. See SpringWebApplication javadoc for
> > how to setup SpringBean based injection.
> > >
> > > I went to Wicket API about SpringWebApplication and it
> > says:
> > >
> > > Deprecated. when using java5 it is preferrable to use
> > SpringBean 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(new
> > SpringComponentInjector(this));
> > >
> > > Please note that it is not: add(new
> > SpringComponentInjector(this));
> > >
> > > 2. In wicket components that access Spring beans:
> > >
> > > @SpringBean
> > > private SupportService supportService;
> > >
> > >
> > > Am I doing Spring in Wicket right way?
> > >
> > > Thanks for input!
> > >
> > >
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: A question about using Spring in Wicket 1.4
Posted by Matthias Keller <ma...@ergon.ch>.
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<jc...@carmanconsulting.com> wrote:
>
>
>> From: James Carman<jc...@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<da...@yahoo.com>
>> wrote:
>>
>>> Yesterday I was looking at the page "Migrating to
>>>
>> Wicket 1.4"
>>
>>> http://cwiki.apache.org/WICKET/migrating-to-wicket-14.html
>>>
>>> Regarding SpringWebApplication, it says:
>>>
>>> SpringWebApplication has been deprecated in favor of
>>>
>> SpringBean annotation. See SpringWebApplication javadoc for
>> how to setup SpringBean based injection.
>>
>>> I went to Wicket API about SpringWebApplication and it
>>>
>> says:
>>
>>> Deprecated. when using java5 it is preferrable to use
>>>
>> SpringBean 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(new
>>>
>> SpringComponentInjector(this));
>>
>>> Please note that it is not: add(new
>>>
>> SpringComponentInjector(this));
>>
>>> 2. In wicket components that access Spring beans:
>>>
>>> @SpringBean
>>> private SupportService supportService;
>>>
>>>
>>> Am I doing Spring in Wicket right way?
>>>
>>> Thanks for input!
>>>
>>>
>>>
>>>
>>>
>>>
Re: A question about using Spring in Wicket 1.4
Posted by David Chang <da...@yahoo.com>.
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 <jc...@carmanconsulting.com> wrote:
> From: James Carman <jc...@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 <da...@yahoo.com>
> wrote:
> > Yesterday I was looking at the page "Migrating to
> Wicket 1.4"
> >
> > http://cwiki.apache.org/WICKET/migrating-to-wicket-14.html
> >
> > Regarding SpringWebApplication, it says:
> >
> > SpringWebApplication has been deprecated in favor of
> SpringBean annotation. See SpringWebApplication javadoc for
> how to setup SpringBean based injection.
> >
> > I went to Wicket API about SpringWebApplication and it
> says:
> >
> > Deprecated. when using java5 it is preferrable to use
> SpringBean 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(new
> SpringComponentInjector(this));
> >
> > Please note that it is not: add(new
> SpringComponentInjector(this));
> >
> > 2. In wicket components that access Spring beans:
> >
> > @SpringBean
> > private SupportService supportService;
> >
> >
> > Am I doing Spring in Wicket right way?
> >
> > Thanks for input!
> >
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: A question about using Spring in Wicket 1.4
Posted by James Carman <jc...@carmanconsulting.com>.
yes
On Thu, Mar 11, 2010 at 8:56 AM, David Chang <da...@yahoo.com> wrote:
> Yesterday I was looking at the page "Migrating to Wicket 1.4"
>
> http://cwiki.apache.org/WICKET/migrating-to-wicket-14.html
>
> Regarding SpringWebApplication, it says:
>
> SpringWebApplication has been deprecated in favor of SpringBean annotation. See SpringWebApplication javadoc for how to setup SpringBean based injection.
>
> I went to Wicket API about SpringWebApplication and it says:
>
> Deprecated. when using java5 it is preferrable to use SpringBean 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(new SpringComponentInjector(this));
>
> Please note that it is not: add(new SpringComponentInjector(this));
>
> 2. In wicket components that access Spring beans:
>
> @SpringBean
> private SupportService supportService;
>
>
> Am I doing Spring in Wicket right way?
>
> Thanks for input!
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org