You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by James Selvakumar <ja...@mcruncher.com> on 2017/01/31 03:36:51 UTC

Can @Inject annotation be used instead of @SpringBean to inject Spring beans?

Hi all,

I've always used @SpringBean annotation to inject Spring beans in my Wicket
components.
We found that we could also use the standard @Inject annotation in Wicket
components.
Is it advisable to use @Inject instead of @SpringBean?
Or should we continue to use @SpringBean?

-- 
Thanks & regards
James

Re: Can @Inject annotation be used instead of @SpringBean to inject Spring beans?

Posted by Pedro Santos <pe...@gmail.com>.
@Inject, it would make it easier to migrate to CDI as well

cheers
Pedro Santos


On Tue, Jan 31, 2017 at 5:26 AM, Martin Grigorov <mg...@apache.org> wrote:
> Hi,
>
> I use @SpringBean in my applications.
> The only reason one to switch to @Inject is if your application may use
> Guice in the future. Using @Inject will make it easier to migrate.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Jan 31, 2017 at 4:36 AM, James Selvakumar <ja...@mcruncher.com>
> wrote:
>
>> Hi all,
>>
>> I've always used @SpringBean annotation to inject Spring beans in my Wicket
>> components.
>> We found that we could also use the standard @Inject annotation in Wicket
>> components.
>> Is it advisable to use @Inject instead of @SpringBean?
>> Or should we continue to use @SpringBean?
>>
>> --
>> Thanks & regards
>> James
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Can @Inject annotation be used instead of @SpringBean to inject Spring beans?

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

I use @SpringBean in my applications.
The only reason one to switch to @Inject is if your application may use
Guice in the future. Using @Inject will make it easier to migrate.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Jan 31, 2017 at 4:36 AM, James Selvakumar <ja...@mcruncher.com>
wrote:

> Hi all,
>
> I've always used @SpringBean annotation to inject Spring beans in my Wicket
> components.
> We found that we could also use the standard @Inject annotation in Wicket
> components.
> Is it advisable to use @Inject instead of @SpringBean?
> Or should we continue to use @SpringBean?
>
> --
> Thanks & regards
> James
>