cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: getComponent vs. context.getAttribute
Date Wed, 12 Mar 2008 10:06:58 GMT
Patrick Heiden wrote:
> Hello together!
> 
> Is there any notable difference in asking for Spring-beans inside flow-scripts wheter
using
> 
> cocoon.getComponent("myBean"); // via avalon-bridge!?
> 
> or
> 
> var appCtx = cocoon.context.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
> appCtx.getBean("myBean");
> 
> ??
> 
Yes, there is a difference :) The first one does not use the avalon 
bridge but uses the context of the current sitemap. This might be a sub 
context of the root web application context with additional/different beans.

So, getComponent() is still the way to go :)

HTH
Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

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


Mime
View raw message