You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by lukaszkaleta <lu...@gmail.com> on 2013/02/06 13:47:21 UTC

Spring injection by interface

I am using tapestry spring with compatibility mode:

This is mine bean definition:



I try this:


but I got following exception 

I also try with 

but no luck.

If I @Inject ApplicationContext I can access the bean from it, but I would
like to get it directly.

I am using tapestry: Tapestry 5.3.6. I am not sure if and where I am doing
something wrong. Could someone give me hint ?






--
View this message in context: http://tapestry.1045711.n5.nabble.com/Spring-injection-by-interface-tp5719810.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Spring injection by interface

Posted by Nicolas Barrera <nb...@gmail.com>.
Hi,

I don't know your full configuration of tapestry and tapestry-spring,
anyway the createWebApplicationContext you 've implemented doesn't seem to
do anything very special.

you could specify your xml contexts locations in your web.xml like this:
    <context-param>
          <param-name>contextConfigLocation</param-name>
          <param-value>
              classpath:/applicationContext1.xml
              classpath:/applicationContext2.xml
          </param-value>
    </context-param>

also I would try to get a basic configuration working first, so I would not
use that customization of yours just to test if it works that way and cut
down the problem to customize the ContextLoaderListener.

btw...
The only way I can see your code snippets is through the nabble site...
perhaps that's preventing others from helping you out :)

cheers

Nicolás.-

Re: Spring injection by interface

Posted by lukaszkaleta <lu...@gmail.com>.
Yes, I am using this library ;)

The only difference I am having is own ContextLoaderListener which do
something like this:






--
View this message in context: http://tapestry.1045711.n5.nabble.com/Spring-injection-by-interface-tp5719810p5719815.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Spring injection by interface

Posted by Nicolas Barrera <nb...@gmail.com>.
Have you read this?
http://tapestry.apache.org/integrating-with-spring-framework.html

you should be using a tapestry library called tapestry-spring for this:

@Inject
private MyBeanClass mbc;

to work.

cheers

Nicolás.-


On Wed, Feb 6, 2013 at 9:47 AM, lukaszkaleta <lu...@gmail.com> wrote:

> I am using tapestry spring with compatibility mode:
>
> This is mine bean definition:
>
>
>
> I try this:
>
>
> but I got following exception
>
> I also try with
>
> but no luck.
>
> If I @Inject ApplicationContext I can access the bean from it, but I would
> like to get it directly.
>
> I am using tapestry: Tapestry 5.3.6. I am not sure if and where I am doing
> something wrong. Could someone give me hint ?
>
>
>
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Spring-injection-by-interface-tp5719810.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>