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?