[Zope] URL Redirection problems...

Vitor Varalonga vpedrosa@ciberbit.pt
Thu, 13 Dec 2001 18:08:36 +0000


--------------148B84AE41F4AFBC219015AD
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

    Hi!


    I'm facing a problem concerning URL redirection inside Zope:

Suppose a try to make a redirection to a DTML document using it's
relative path instead of the absolute one:

DTML >> <dtml-call expr="RESPONSE.redirect('/abc/xpto?a=1&b=2&c=3')">

Python >> container.REQUEST.RESPONSE.redirect("/abc/xpto?a=1&b=2&c=3")

So far so good... The redirection process goes on apparently well.
But if I try to reach the variables I passed in the query string
(e.g., REQUEST["a"]), kaput... what a surprise... they don't exist
in the REQUEST object as I expected.
Apparently the variables are not stored in the REQUEST object.
Now the good thing is that the query string is not lost since its
stored in a special variable called QUERY_STRING. So if I execute:

<dtml-var expr="REQUEST['QUERY_STRING']">

I should get: "a=1&b=2&c=3"

I can always parse the string and get the values for each variable,
but is there any logical explanation for this?


Thanks in advance,

Vitor Varalonga

--------------148B84AE41F4AFBC219015AD
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<tt>&nbsp;&nbsp;&nbsp; Hi!</tt>
<br><tt></tt>&nbsp;<tt></tt>
<p><tt>&nbsp;&nbsp;&nbsp; I'm facing a problem concerning URL redirection
inside Zope:</tt><tt></tt>
<p><tt>Suppose a try to make a redirection to a DTML document using it's</tt>
<br><tt>relative path instead of the absolute one:</tt><tt></tt>
<p><tt>DTML >> &lt;dtml-call expr="RESPONSE.redirect('/abc/xpto?a=1&amp;b=2&amp;c=3')"></tt><tt></tt>
<p><tt>Python >> container.REQUEST.RESPONSE.redirect("/abc/xpto?a=1&amp;b=2&amp;c=3")</tt><tt></tt>
<p><tt>So far so good... The redirection process goes on apparently well.</tt>
<br><tt>But if I try to reach the variables I passed in the query string</tt>
<br><tt>(e.g., REQUEST["a"]), kaput... what a surprise... they don't exist</tt>
<br><tt>in the REQUEST object as I expected.</tt>
<br><tt>Apparently the variables are not stored in the REQUEST object.</tt>
<br><tt>Now the good thing is that the query string is not lost since its</tt>
<br><tt>stored in a special variable called QUERY_STRING. So if I execute:</tt><tt></tt>
<p><tt>&lt;dtml-var expr="REQUEST['QUERY_STRING']"></tt><tt></tt>
<p><tt>I should get: "a=1&amp;b=2&amp;c=3"</tt><tt></tt>
<p><tt>I can always parse the string and get the values for each variable,</tt>
<br><tt>but is there any logical explanation for this?</tt>
<br><tt></tt>&nbsp;<tt></tt>
<p><tt>Thanks in advance,</tt><tt></tt>
<p><tt>Vitor Varalonga</tt></html>

--------------148B84AE41F4AFBC219015AD--