cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexis Georges <>
Subject Avoiding non-existent URIs
Date Fri, 22 May 2009 12:31:57 GMT
Hello everyone,

I have been using Cocoon with XSLT (2.0) and eXist for a simple blog.

I have some simple matchers as follows:

"news/*/" => "news/2009/"
"news/*/*/" => "news/2009/05/"
"news/*/*/*/ => "news/2009/05/22/"

I then have a resource which loads a template into the pipeline, and  
applies a stylesheet. This stylesheet calls document() on an Atom feed  
document stored in eXist, and filters the feed to contain only the  
valid entries for the given wildcards (date, month, day).

One thing I had not realized was that there is a big problem with this:

"news/1234/" will work fine, but obviously something is wrong: I  
should return a 404 (or at least not a 200).

But with the current (simple) setup, how could I do that?

In the XSLT I can obviously know that there were no matching entries,  
hence a call to error() would return control to Cocoon which could  
handle the "Internal Server Error", and in that pipeline context, such  
an error would be understand to mean that the resource was not found,  
hence a 404.

Do you have any hints or suggestions? Is this a reasonable way of  
ruling out invalid URI?


Alexis Georges

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message