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 Meulemans <me...@gmail.com> on 2010/06/29 15:30:14 UTC

@SpringBean not working for IModel implementations?

Hi

I've got an implementation of the IModel interface and I want to inject a
Spring bean in it.

In the method public String getObject(); this object is null.

Is it impossible to inject Spring beans with @SpringBean?

thx in advance!

David

Re: @SpringBean not working for IModel implementations?

Posted by david_ <me...@gmail.com>.
Thanks, I'll give it a try!

2010/6/29 Ernesto Reinaldo Barreiro-4 [via Apache Wicket] <
ml-node+2272202-1574848512-232081@n4.nabble.com<ml...@n4.nabble.com>
>

> I think component instantiation listener will only scan wicket
> components. Just try
>
> InjectorHolder.getInjector().inject(this);
>
> on constructor of the model to get your dependencies injected.
>
> Best,
>
> Ernesto
>
>
> On Tue, Jun 29, 2010 at 3:30 PM, David Meulemans
> <[hidden email] <http://user/SendEmail.jtp?type=node&node=2272202&i=0>>
> wrote:
>
> > Hi
> >
> > I've got an implementation of the IModel interface and I want to inject a
>
> > Spring bean in it.
> >
> > In the method public String getObject(); this object is null.
> >
> > Is it impossible to inject Spring beans with @SpringBean?
> >
> > thx in advance!
> >
> > David
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=2272202&i=1>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=2272202&i=2>
>
>
>
> ------------------------------
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/SpringBean-not-working-for-IModel-implementations-tp2272189p2272202.html
> To start a new topic under Wicket - User, email
> ml-node+1842947-1066186228-232081@n4.nabble.com<ml...@n4.nabble.com>
> To unsubscribe from Wicket - User, click here<http://apache-wicket.1842946.n4.nabble.com/subscriptions/Unsubscribe.jtp?code=bWV1bGVtYW5zLmRhdmlkQGdtYWlsLmNvbXwxODQyOTQ3fC0xOTcyOTcxMjQ2>.
>
>
>

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/SpringBean-not-working-for-IModel-implementations-tp2272189p2272642.html
Sent from the Wicket - User mailing list archive at Nabble.com.

Re: @SpringBean not working for IModel implementations?

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
I think component instantiation listener will only scan wicket
components. Just try

InjectorHolder.getInjector().inject(this);

on constructor of the model to get your dependencies injected.

Best,

Ernesto


On Tue, Jun 29, 2010 at 3:30 PM, David Meulemans
<me...@gmail.com> wrote:
> Hi
>
> I've got an implementation of the IModel interface and I want to inject a
> Spring bean in it.
>
> In the method public String getObject(); this object is null.
>
> Is it impossible to inject Spring beans with @SpringBean?
>
> thx in advance!
>
> David
>

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


Re: @SpringBean not working for IModel implementations?

Posted by James Carman <ja...@carmanconsulting.com>.
Try using

InjectorHolder.getInjector().inject(this);

inside your model implementation's constructor.

On Tue, Jun 29, 2010 at 9:30 AM, David Meulemans
<me...@gmail.com> wrote:
> Hi
>
> I've got an implementation of the IModel interface and I want to inject a
> Spring bean in it.
>
> In the method public String getObject(); this object is null.
>
> Is it impossible to inject Spring beans with @SpringBean?
>
> thx in advance!
>
> David
>

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