Hello, I have seen this in an example to redirect from a Script to a Page Template: return container.index_html(REQUEST) It seems like this sends the REQUEST variable to the index_html. I would like to use return context.REQUEST.RESPONSE.redirect(getattr(context,"add.html").absolute_url()) because there is a point character in my id (add.html). Does the "context.REQUEST.RESPONSE.redirect" send the REQUEST variable to my add.html, too? Or do I have to send an object id with this redirect like: return context.REQUEST.RESPONSE.redirect(getattr(context,"add.html").absolute_url()) + "?id=" + myID Can anybody help?
hi, On Aug 25, 2004, at 5:08 AM, lists@christof-doerflinger.de wrote:
Hello,
I have seen this in an example to redirect from a Script to a Page Template:
return container.index_html(REQUEST)
It seems like this sends the REQUEST variable to the index_html.
this returns the output the page template directly from the request for the script.
I would like to use
return context.REQUEST.RESPONSE.redirect(getattr(context,"add.html").absolute_ url())
this will return an http redirect 30x response with the given url to the browser, which then re-requests that url. (not sure what the default redirect response is..307-temporary? ..302-permanent? ..something else?)
because there is a point character in my id (add.html). Does the "context.REQUEST.RESPONSE.redirect" send the REQUEST variable to my add.html, too?
no, because the browser is making a completely new request for the passed url.
Or do I have to send an object id with this redirect like:
return context.REQUEST.RESPONSE.redirect(getattr(context,"add.html").absolute_ url()) + "?id=" + myID
almost... return context.REQUEST.RESPONSE.redirect( getattr(context, 'add.html').absolute_url()+'?id='+myID ) thats one way to do it, or you could set the id variable in the request object before you called the first example. context.REQUEST.set('id', myID) return container.index_html(context.REQUEST) thanks, travis
On Aug 25, 2004, at 7:23 AM, Travis Miller wrote:
this will return an http redirect 30x response with the given url to the browser, which then re-requests that url. (not sure what the default redirect response is..307-temporary? ..302-permanent? ..something else?)
301 - permanent 302 - found, temporary (default) 307 - temporary ? http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html http://zope.org/Documentation/Books/ZopeBook/2_6Edition/AppendixB.stx <-- find redirect thanks, travis
participants (2)
-
lists@christof-doerflinger.de -
Travis Miller