cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: [bug?] exception thrown in sendPage() skips the proper error handler
Date Mon, 03 Nov 2003 12:02:36 GMT

On Saturday, Nov 1, 2003, at 19:27 Europe/Rome, Sylvain Wallez wrote:

> Stefano Mazzocchi wrote:
>
>>
>> On Saturday, Nov 1, 2003, at 12:09 Europe/Rome, Guido Casper wrote:
>>
>>> See also:
>>> http://marc.theaimsgroup.com/?t=106313753000002&r=1&w=2
>>
>>
>> Great, so it's a bug.
>>
>> What's the status of this? has it been filed on bugzilla yet?
>>
>> Sylvain, any suggestions on how to fix it as Vadim proposed?
>
>
> ?? IIRC, I fixed it as indicated...
>
> Can you expand on the problem, i.e. post relevant snippets that show 
> which error handler is called in which circumstances.

go into the "webdav" block into the "davmap" folder and look at the 
sitemap.

suppose you get a request "GET repo/whatever HTTP/1.1", the following 
matcher is executed

       <map:match pattern="repo/**">
         <map:call function="selectMethod">
           <map:parameter name="page" value="{1}"/>
         </map:call>
       </map:match>

calling this function in "webdav.js"

function selectMethod() {
   var page = cocoon.parameters["page"];
   var method = cocoon.request.getMethod();
   print(method + " " + page);
   cocoon.sendPage(method+"/"+page, null);
}

[print was added by me to see if I reached there] which goes back to 
the sitemap as [simplified by me now for readability]

       <map:match pattern="GET/**">
         <map:match pattern="GET/**.*">
           <map:generate src="{1}.{2}"/>
           <map:serialize type="xml"/>
         </map:match>
         <map:generate type="traverse" src="{1}">
           <map:parameter name="depth" value="1"/>
         </map:generate>
         <map:transform src="styles/collection2html.xsl"/>
         <map:serialize type="html"/>
       </map:match>

       <map:handle-errors>
         <map:read src="error.html" mime-type="text/html" 
status-code="404"/>
       </map:handle-errors>

where "error.html" is my own error page (very simple, almost empty).

If the page is not found, this error handler is not invoked, but it 
falls back on the root sitemap's one.

Either I'm missing something, or it's a bug.

--
Stefano.


Mime
View raw message