On Tue, 24 Jul 2012 16:17:31 -0300, Vladimir Bauer <vba...@slb.com> wrote:

Hi!

Hi!

I can inject my dataDao in com.myapp.pages package, there is no problem.
But I have a package com.myapp.model where I need to use dataDao as well, injecting doesn't work in this package, I end up with null pointer exception.

In pages, components and mixins, Tapestry injects services (including Spring beans if tapestry-spring is used and correctly configured).

Tapestry-IoC injection only works in objects instatiated by itself. If you want to inject Spring beans into objects, you either turn them into Spring beans, Tapestry-IoC services or you inject ObjectLocator and use its getService() methods to get the services/beans programatically.

So as workaround I have to pass my dataDao bean from pages classes to model classes as argument in constructor of any model's class.

What do you mean by model classes?

--
Thiago H. de Paula Figueiredo

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

Reply via email to