[Zope] redirect strangeness ...

Dennis Allison allison@sumeru.stanford.EDU
Mon, 26 Aug 2002 10:15:29 -0700


Thanks Charlie, but it's the other side of the dtml-if that's failing.   
The side that uses marshallwormvar() works fine.  It's the unadorned
redirect to index_html that rises the exception.  

>"Charlie Reiman" <creiman@kefta.com> wrote in response:
>
>I can't say specifically, but %3A is ':', so I'd guess marshaformvars() is
>returning something with a ':' in it, which might confuse the browser. Try
>URL encoding that part.
>
>FWIW, using the standard headers and footers is a waste of time here, since
>redirect is part of the HTTP headers which appears before any HTML.
>
>> -----Original Message-----
>> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
>> Dennis Allison
>> Sent: Sunday, August 25, 2002 9:46 PM
>> To: zope@zope.org
>> Subject: [Zope] redirect strangeness ...
>>
>>
>> This dtml fragment fails strangely ---
>>
>>    <dtml-var standard_header_html>
>>    <dtml-if expr=pythonscript()>
>>    	<dtml-call expr="REQUEST['RESPONSE'].redirect('index_html')">
>>    <dtml-else>
>>    	<dtml-call
>> expr="REQUEST['RESPONSE'].redirect('originalform?'+marshallformvars())">
>>    </dtml-if>
>>    <dtml-var standard_footer_html>
>>
>> The pythonscript() validates the form variables.  marshallformvars()
>> is a python script that returns the appropriately quoted name/value pairs.
>>
>> The observed behavior is strange.  If the pythonscript() returns 0, the
>> transfer to the originalform occurs along with the diagnostic information
>> inserted by the validation script.  This is the behavior I expect.
>>
>> But when the pythonscript() returns 1, I get a Zope error indicating
>> that the sytem cannot find, not index_html but
>>
>> 	/aaa/bbb/ccc/ddd/%3A
>>
>> Both the index_html and the failing dtml-method are in the folder
>> referenced via the path /aaa/bbb/ccc/ddd.
>>
>> As a workaround I replaced the first redirect with a <dtml-var index_html>
>> but I do wonder why the initial approach failed.  Insight appreciated.