[ Dennis Allison]
Zope uses use GET for URL/cgi information transfer.
Not so, Zope can use both GET and POST, and REQUEST works the same way for both.
Most browsers expose the information transfered via a GET in the displayed URL. Some of our users find this confusing. Is there a simple way to avoid the URL display as users traverse the site?
The Web Way is to submit information to the server (especially data that might change the state of the server or its data) using POST, otherwise to retrieve information with GET. There is nothing to stop you from using a POST for submitting length form data if you want to. Sounds like there is some crucial bit of information you have not told us. Cheers, Tom P
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? On Fri, 9 May 2003, Passin, Tom wrote:
[ Dennis Allison]
Zope uses use GET for URL/cgi information transfer.
Not so, Zope can use both GET and POST, and REQUEST works the same way for both.
Most browsers expose the information transfered via a GET in the displayed URL. Some of our users find this confusing. Is there a simple way to avoid the URL display as users traverse the site?
The Web Way is to submit information to the server (especially data that might change the state of the server or its data) using POST, otherwise to retrieve information with GET. There is nothing to stop you from using a POST for submitting length form data if you want to.
Sounds like there is some crucial bit of information you have not told us.
Dennis Allison wrote:
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?
You don't. Don't combine redirects and POST, its unreliable. rule of thumb: Avoid redirects wherever you can. -- Jamie Heilman http://audible.transient.net/~jamie/ "It's almost impossible to overestimate the unimportance of most things." -John Logue
On Fri, 9 May 2003, Jamie Heilman wrote in response to Dennis Allison's query:
How do you get Zope to use POST as its default rather than GET?
You don't. Don't combine redirects and POST, its unreliable. rule of thumb: Avoid redirects wherever you can.
So, what would you use instead of redirects? I have a number of idiomatic uses where they are treated as programmable, self-executing hyperlinks to transfer control from one object to another, dragging along parameters as I go. So far it has been a reliable and robust mechanism, at least for me using the GET method.
Jamie Heilman wrote:
Dennis Allison wrote:
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?
You don't. Don't combine redirects and POST, its unreliable. rule of thumb: Avoid redirects wherever you can.
It sounds like bad advice to me. Redirects are correctly implemented in probably any browser out there. I have never had practical problems using redirects. Why should it be unreliable? regards Max M
Max M wrote:
Jamie Heilman wrote:
Dennis Allison wrote:
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?
You don't. Don't combine redirects and POST, its unreliable. rule of thumb: Avoid redirects wherever you can. It sounds like bad advice to me. Redirects are correctly implemented in probably any browser out there. I have never had practical problems using redirects. Why should it be unreliable?
3 distinct statements really, but when I said "don't combine redirect's and POST", what I ment was, don't respond with a redirect to a query containing POST data, this has been problematic for ages: http://ppewww.ph.gla.ac.uk/~flavell/www/post-redirect.html Avoiding redirects in your web design means you don't run into stuff like this. -- Jamie Heilman http://audible.transient.net/~jamie/ "Most people wouldn't know music if it came up and bit them on the ass." -Frank Zappa
On Fri, 2003-05-09 at 13:00, Dennis Allison wrote:
How do you transfer information via post when using REQUEST['RESPONSE'].redirect?
Don't do that... redirects are generally to be avoided and re-posting data is a particularly bad application. The page (object) that catches the form is the URL that should appear to the user. Where the information actually comes from is another question entirely. Let's say you have the following objects: some_form (the form) some_form_proc (the form target) some_content (what you want returned) In some_form you have: <form action=some_form_proc method=post> <input type=some_field> Etc., etc. In some_form_proc you have: <dtml-var "do_something(REQUEST.get(some_field))"> ... <dtml-var "some_content(REQUEST)"> And then just put whatever context-sensitive code in some_content you want to see returned. All done! HTH, Dylan
Thanks. Helpful too. -d On 9 May 2003, Dylan Reinhardt wrote:
On Fri, 2003-05-09 at 13:00, Dennis Allison wrote:
How do you transfer information via post when using REQUEST['RESPONSE'].redirect?
Don't do that... redirects are generally to be avoided and re-posting data is a particularly bad application.
The page (object) that catches the form is the URL that should appear to the user. Where the information actually comes from is another question entirely.
Let's say you have the following objects:
some_form (the form) some_form_proc (the form target) some_content (what you want returned)
In some_form you have:
<form action=some_form_proc method=post> <input type=some_field>
Etc., etc.
In some_form_proc you have:
<dtml-var "do_something(REQUEST.get(some_field))"> ... <dtml-var "some_content(REQUEST)">
And then just put whatever context-sensitive code in some_content you want to see returned. All done!
HTH,
Dylan
_______________________________________________ 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 )
participants (5)
-
Dennis Allison -
Dylan Reinhardt -
Jamie Heilman -
Max M -
Passin, Tom