cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <scher...@gmail.com>
Subject Re: Cocoon 2.1 sitemap broken in Tomcat 6
Date Thu, 17 May 2012 18:56:30 GMT
On 05/17/2012 07:32 PM, Bob Harrod wrote:
> We've recently upgraded our Cocoon 2.1 based web app from Tomcat 4 to 
> Tomcat 6.  Our sitemaps were written with a somewhat invalid matchers 
> which worked in Tomcat 4:
>
> For example:
>
> <map:match pattern="/basicthing">
> ...
> </map:match>
>
>
> Tomcat 6 more adequately adheres to the HTTP URL spec and appends a 
> trailing slash.  Of course, the trailing slash breaks the matcher 
> above. The following matcher would work in Tomcat 6 but breaks all of 
> the matchers for Tomcat 4:
>
> <map:match pattern="/basicthing/">
> ...
> </map:match>
>
>
> To avoid duplication, I've written a matcher to catch this case to 
> avoid duplicating matchers:
>
> <map:match pattern="*/">
> <map:redirect-to uri="cocoon:/{1}"/>
> </map:match>
>
>
> While this works for the basic case, it is not recursive, and as soon 
> as a url pattern goes past basic thing (/basicthing/morethings/), I 
> need another matcher to catch this case ("*/*/").
>
> Is there a way to create a recursive matcher in cocoon to catch 
> multiple slashes and end at a trailing slash?  I'm thinking something 
> like:
>
> <map:match pattern="**/">
> <map:redirect-to uri="cocoon:/{1}"/>
> </map:match>
>
> Would that work?

yes

salu2

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

http://www.codebusters.es/


Mime
View raw message