You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Boris Goldowsky <bg...@cast.org> on 2008/06/10 05:11:03 UTC

ApplicationContext from sitemap component?

So the archetype demos make it clear that from flowscript you can look
up a Spring bean with cocoon.getComponent("name"), but what is the
recommended method for looking one up from inside a Transformer or other
sitemap component?

Thanks,

Bng




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


Re: ApplicationContext from sitemap component?

Posted by Boris Goldowsky <bg...@cast.org>.
Ah, I did not realize you could set up sitemap components as Spring
beans -- I had been defining them the Cocoon 2.1 way, in a
<map:components> element in the sitemap.  Is there an example somewhere
of how to set them up via Spring?

Bng


On Wed, 2008-06-11 at 18:02 +0200, Grzegorz Kossakowski wrote:
> Boris Goldowsky pisze:
> > So the archetype demos make it clear that from flowscript you can look
> > up a Spring bean with cocoon.getComponent("name"), but what is the
> > recommended method for looking one up from inside a Transformer or other
> > sitemap component?
> 
> The recommended way is to have sitemap component as a Spring bean and use Dependency Injection for 
> getting all dependencies resolved.
> 

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


Re: ApplicationContext from sitemap component?

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Boris Goldowsky pisze:
> So the archetype demos make it clear that from flowscript you can look
> up a Spring bean with cocoon.getComponent("name"), but what is the
> recommended method for looking one up from inside a Transformer or other
> sitemap component?

The recommended way is to have sitemap component as a Spring bean and use Dependency Injection for 
getting all dependencies resolved.

-- 
Grzegorz Kossakowski

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