Carsten Ziegeler wrote:

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.

ok, didn't know this as the inclusion mechanism of the former spring-app block was different.

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.

ok. Than I will try to use the standard Spring way:

<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

in the cocoon-22-webapp-archetype but I guess this will not work together with paranoid classloading and the reloading classloader because the listener is declared outside of Cocoon.

                                   - o -

Apart from that I will add

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

to the cocoon.xconf so that we can have bean definition files in blocks.


--
Reinhard Pötz Independent Consultant, Trainer & (IT)-Coach
{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                       web(log): http://www.poetz.cc
--------------------------------------------------------------------

        

        
                
___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

Reply via email to