cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: Spring - conf/applicationContext.xml | global bean definitions
Date Mon, 29 May 2006 11:03:43 GMT
Reinhard Poetz wrote:
> Carsten Ziegeler wrote:
> 
>> It's already there :) In the webapp under samples/spring. The last time
>> I checked it (some weeks ago) it worked using:
>> http://localhost:8888/samples/spring.
> 
> Thanks, I found the samples and they still work :-)
Great, thanks for testing!

>                                        - o -

> 
> I'm not perfectly happy with having the Spring configuration in 
> "conf/applicationContext.xml" which is relative to the sitemap it belongs to. 
> What about having applicationContext.xml in the same directory as the sitemap as 
> default?
Hmm, I don't know what's best, but there is no default automatic include
for this, so you have to add an include in the sitemap anyway. Imho you
should move your configuration into a subdirectory and not in the same
as the sitemap itself.

> 
> Anyway, I'm not sure if I want to have Spring components at sitemap level at all 
> (at least in my applications). 
It's optional :)

> I would prefer having some global mechanism,
> similar to WEB-INF/xconf for Spring beans. We could introduce something like 
> WEB-INF/spring/ into which you can put as many bean definition files as you want.
Oh, this already works! Just put a:

<include-beans dir="context://WEB-INF/spring" pattern="*.xml/>

in the cocoon.xconf.

(Ok, to be honest, I haven't tested it yet, but it should work...).

Now, I don't know if you need this as this is Cocoon specific. If you
use Spring, you usually setup your application context via the web.xml
and configure the location of the xml files there as well. So I'm not
sure if there is a need for our own global inclusion mechanism. If
you're using Spring this way, the Spring application context is the
parent of Cocoon's bean factory, so all beans are available within Cocoon.

Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Mime
View raw message