cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Unico Hommes" <>
Subject redirect-to from sendPage
Date Sun, 01 Feb 2004 14:35:18 GMT

Given the following sitemap:

<?xml version="1.0" encoding="UTF-8"?>
<map:sitemap xmlns:map="">

  <map:flow language="javascript">
     <map:script src="flow.js"/>
      <map:match pattern="test">
        <map:call function="sendPageWithRedirect"/>
      <map:match pattern="redirect">
        <map:redirect-to uri="success"/>
      <map:match pattern="success">
        <map:read src="sitemap.xmap"/>

... and the following flowscript:

function sendPageWithRedirect() {

requesting 'test' will return an empty page to the browser.

The reason that this does not work is because the flow interpreter
implements sendPage as any other internal request.

Now, please correct me if I am wrong, but I tend to think that it should
be possible to do a sendPage to a redirect-to and that therefore the
current behavior is buggy. Because, whereas calling a sitemap source
using the cocoon: protocol obviously should not cause the client to
redirect, this is not so obvious to me in case of a sendPage because the
pipeline that is called here is top-level from the perspective of the
flow script.

If I consider this from the point of view of nested Environment objects,
I don't see a reason for the sendPage Environment to stop the redirect
call from reaching the client.

I've run into this problem in the past, and at least one person on the
users list has also. We need to decide what stance we take on this and
either fix it or document it properly.



View raw message