[Dennis Allison]
How do you transfer information via post when using REQUEST['RESPONSE'].redirect?
How do you get Zope to use POST as its default rather than GET?
Hmm, methinks you do not have a clear idea of how these things work. The choice of POST vs GET is not up to Zope per se. It is up to the User Agent, which in practice means it is up to the design of the web page itself. There is no Zope "default". If you want to redirect to a new page and pass some information to the redirected page while you do so, you would give the information to the page template via (typically) REQUEST variables (which you can set during Zope processing) - or other Zope variables - so that the DTML or ZPT that builds the redirected page can include the data into the page. Sometimes the data ends up populating visible or hidden fields in a form, sometimes you decide to apply it in other ways. At this level, neither GET nor POST is involved, since it would happen before the page is built and sent back to the browser. If this is not helpful enough, then give us a few (simplified and clear) scenarios tha trouble you, and maybe we can help clarify and simplify. Cheers, Tom P
Sorry, Tom, sarcasm does not play well on the list and especially not when it's taken out of context. My original question was to find a way to eliminate the display of information in the browser's address window. Typically this comes from passing information with a URL either by having an actual hyperlink or through using a redirect and passing parameter with it. There are Javascript mechanisms which might work but they all require signed scripts--something my environment can't support. One could wrap everything in a unitary frame set and run full screen--possibly the right solution eventually but not for the moment. I'm still pondering this problem. Jamie has suggested that redirection is a bad idea and that I'd be better off using some other mechanism both for the transfer of control and to pass variables. You are suggesting much the same: that an idiom that explicitly constructs and passes a REQUEST object explicitly may be better than using the URL parameter mechanism may be a better approach. I'll try that out on a few use cases and see how it plays. We are currently beginning to re-engineer and scale-up our system so now's a good time to do so. On Fri, 9 May 2003, Passin, Tom wrote:
[Dennis Allison]
How do you transfer information via post when using REQUEST['RESPONSE'].redirect?
How do you get Zope to use POST as its default rather than GET?
Hmm, methinks you do not have a clear idea of how these things work. The choice of POST vs GET is not up to Zope per se. It is up to the User Agent, which in practice means it is up to the design of the web page itself. There is no Zope "default".
If you want to redirect to a new page and pass some information to the redirected page while you do so, you would give the information to the page template via (typically) REQUEST variables (which you can set during Zope processing) - or other Zope variables - so that the DTML or ZPT that builds the redirected page can include the data into the page. Sometimes the data ends up populating visible or hidden fields in a form, sometimes you decide to apply it in other ways. At this level, neither GET nor POST is involved, since it would happen before the page is built and sent back to the browser.
If this is not helpful enough, then give us a few (simplified and clear) scenarios tha trouble you, and maybe we can help clarify and simplify.
Dennis, A good while ago Jim Penny posted a message that described a really interesting coding construct. One of it benefits is that the URL always stays the same. I never thanked Jim for posting the original msg but I've put this technique to good use! The idea is the you turn your INDEX_HTML into something of an infinite loop. If is filled with statements like: <DTML-IF current_state = 'MAIN' and action = 'VENDORS'> <dtml-var vendorsForm> <DTML-IF current_state = 'MAIN' and action = 'EMPLOYEES'> <dtml-var employeesForm> Anyway, you can find original article at http://zope.nipltd.com/public/lists/zope-archive.nsf/47ba74c812dbc5dd8025687 f0024bb5f/91d6497a4b1c5ade802569dd005d5881?OpenDocument David
My original question was to find a way to eliminate the display of information in the browser's address window. Typically this comes from passing information with a URL either by having an actual hyperlink or through using a redirect and passing parameter with it.
What a lot of good ideas from one simple post (POST?). Thank you. Charles ----- Original Message ----- From: "David Hassalevris" <bluepaul@earthlink.net> To: "Dennis Allison" <allison@sumeru.stanford.EDU> Cc: <zope@zope.org> Sent: Saturday, May 10, 2003 12:44 AM Subject: Re: [Zope] GET vs. POST
Dennis,
A good while ago Jim Penny posted a message that described a really interesting coding construct. One of it benefits is that the URL always stays the same.
I never thanked Jim for posting the original msg but I've put this technique to good use!
The idea is the you turn your INDEX_HTML into something of an infinite loop.
If is filled with statements like:
<DTML-IF current_state = 'MAIN' and action = 'VENDORS'> <dtml-var vendorsForm> <DTML-IF current_state = 'MAIN' and action = 'EMPLOYEES'> <dtml-var employeesForm>
Anyway, you can find original article at
http://zope.nipltd.com/public/lists/zope-archive.nsf/47ba74c812dbc5dd8025687 f0024bb5f/91d6497a4b1c5ade802569dd005d5881?OpenDocument
David
My original question was to find a way to eliminate the display of information in the browser's address window. Typically this comes from passing information with a URL either by having an actual hyperlink or through using a redirect and passing parameter with it.
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
"David Hassalevris" <bluepaul@earthlink.net> writes:
Dennis,
A good while ago Jim Penny posted a message that described a really interesting coding construct. One of it benefits is that the URL always stays the same.
I never thanked Jim for posting the original msg but I've put this technique to good use!
The idea is the you turn your INDEX_HTML into something of an infinite loop.
If is filled with statements like:
<DTML-IF current_state = 'MAIN' and action = 'VENDORS'> <dtml-var vendorsForm> <DTML-IF current_state = 'MAIN' and action = 'EMPLOYEES'> <dtml-var employeesForm>
Anyway, you can find original article at
http://zope.nipltd.com/public/lists/zope-archive.nsf/47ba74c812dbc5dd8025687 f0024bb5f/91d6497a4b1c5ade802569dd005d5881?OpenDocument
David
I personally find that this sort of stuff is almost always clearer when it is expressed in Python instead of DTML. Most of my index_html files are actually Pythonscripts that look something like this: req = container.REQUEST if req.has_key('some_flag'): return container.some_form() elif req.has_key('some_other_flag'): return container.some_other_form() else: return container.main_form()
participants (5)
-
Charles Zealey -
David Hassalevris -
Dennis Allison -
Jason Earl -
Passin, Tom