You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by leon <ma...@gmail.com> on 2011/03/16 03:53:35 UTC

How to inject Spring Bean by name?

Hi all,
We need to inject more than one implementings of service interface, so how
to do that?
Thanks!

-- 
Best Regards
Li Guoqiang

Re: How to inject Spring Bean by name?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
This should be posted in the users mailing list, not the dev one.

On Tue, 15 Mar 2011 23:53:35 -0300, leon <ma...@gmail.com> wrote:

> Hi all,
> We need to inject more than one implementings of service interface, so  
> how
> to do that?
> Thanks!
>


-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
Coordenador e professor da Especialização em Engenharia de Software com  
Ênfase em Java da Faculdade Pitágoras
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: How to inject Spring Bean by name?

Posted by leon <ma...@gmail.com>.
Thanks ,got it.

On Thu, Mar 17, 2011 at 11:38 AM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Thu, 17 Mar 2011 00:37:19 -0300, Jonathan Barker <
> jonathan.theitguy@gmail.com> wrote:
>
>  This is only the case when 5.0 compatibility mode has been enabled.  This
>> is something that broke (well, broke some of my stuff) between 5.0 and 5.1.
>>
>
> I stand corrected. :) I've been using the compatibility mode since 5.1 came
> out, so I didn't remember this detail. Thanks Jonathan!
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>



-- 
Best Regards
Li Guoqiang

Re: How to inject Spring Bean by name?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 17 Mar 2011 00:37:19 -0300, Jonathan Barker  
<jo...@gmail.com> wrote:

> This is only the case when 5.0 compatibility mode has been enabled.   
> This is something that broke (well, broke some of my stuff) between 5.0  
> and 5.1.

I stand corrected. :) I've been using the compatibility mode since 5.1  
came out, so I didn't remember this detail. Thanks Jonathan!

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: How to inject Spring Bean by name?

Posted by Jonathan Barker <jo...@gmail.com>.
This is only the case when 5.0 compatibility mode has been enabled.  This is
something that broke (well, broke some of my stuff) between 5.0 and 5.1.

On Wed, Mar 16, 2011 at 11:21 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Wed, 16 Mar 2011 23:45:49 -0300, leon <ma...@gmail.com> wrote:
>
>  I think Tapestry-spring shout support inject by name out of box.
>>
>
> It does: use @InjectService("beanName") instead of @Inject.
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>



-- 
Jonathan Barker
ITStrategic

Re: How to inject Spring Bean by name?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 16 Mar 2011 23:45:49 -0300, leon <ma...@gmail.com> wrote:

> I think Tapestry-spring shout support inject by name out of box.

It does: use @InjectService("beanName") instead of @Inject.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: How to inject Spring Bean by name?

Posted by leon <ma...@gmail.com>.
I think Tapestry-spring shout support inject by name out of box.

On Thu, Mar 17, 2011 at 10:28 AM, Jonathan Barker <
jonathan.theitguy@gmail.com> wrote:

> You can either inject the ApplicationContext and get the bean from that, or
> you can try what is described here:
>
>
> http://stackoverflow.com/questions/2684171/tapestry-5-and-spring-beans-with-same-interface
>
> I haven't tried it myself, but it is a way around the current limitation of
> Spring bean injection in Tapestry.
>
>
> On Wed, Mar 16, 2011 at 9:22 PM, leon <ma...@gmail.com> wrote:
>
> > Hi all,
> > We need to inject more than one implementings of service interface, so
> how
> > to do that?
> > Thanks!
> >
> > --
> > Best Regards
> > Li Guoqiang
> >
>
>
>
> --
> Jonathan Barker
> ITStrategic
>



-- 
Best Regards
Li Guoqiang

Re: How to inject Spring Bean by name?

Posted by Jonathan Barker <jo...@gmail.com>.
You can either inject the ApplicationContext and get the bean from that, or
you can try what is described here:

http://stackoverflow.com/questions/2684171/tapestry-5-and-spring-beans-with-same-interface

I haven't tried it myself, but it is a way around the current limitation of
Spring bean injection in Tapestry.


On Wed, Mar 16, 2011 at 9:22 PM, leon <ma...@gmail.com> wrote:

> Hi all,
> We need to inject more than one implementings of service interface, so how
> to do that?
> Thanks!
>
> --
> Best Regards
> Li Guoqiang
>



-- 
Jonathan Barker
ITStrategic

How to inject Spring Bean by name?

Posted by leon <ma...@gmail.com>.
Hi all,
We need to inject more than one implementings of service interface, so how
to do that?
Thanks!

-- 
Best Regards
Li Guoqiang