cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <>
Subject c2.2.1 webapp blocklistener changes
Date Tue, 11 Sep 2012 12:50:03 GMT
Hi all,

I am ATM trying to upgrade a client project to use 2.2.1 but I am 
running into a problem where I see 2 solutions. I write it here so 
people that are doing an upgrade can benefit from our findings.

One big change in 2.2.1 is that the servlet connections are not forced 
to define any more in the spring config of the war since we are using 
the BlockDeploymentServletContextListener in the web.xml.

Now in the client project we have in 
src/main/webapp/WEB-INF/applicationContext.xml (which worked fine before)

<bean id="es.sadesi.boja" class="org.apache.cocoon.sitemap.SitemapServlet">
     <servlet:context mount-path="" context-path="/">
         <entry key="clientBlock" value-ref="es.clientBlock.service"/>

This is due to the fact that the war project has its own sitemap and 
needs to listen to all other mounts. Now the above will fail complaining 
about missing protocol.

So I tried to use context-path="context:/" but then I get complains 
about the context:/ protocol is not defined. So for testing I pointed to 
the target dir of the deploy like 

With the last is working but it is not really a valid solution in case 
you deploy to e.g. tomcat, since the context needs to dynamically set.

A possible solution would be that I do a rewrite of the war block and 
move all sitemap stuff to a block on its own and set there the 
mount-path to /. However that solution is not my favourite since it 
means that I need to re-factor quite a lot of code.

So my question is I guess how can I configure the war servlet so its 
mounts on / and use the servlet- context?

Any ideas welcome.

Thorsten Scherler <>
codeBusters S.L. - web based systems
<consulting, training and solutions>

View raw message