[Zope] can one pass values through the 'action' property?
Florent Guillaume
fg@nuxeo.com
Mon, 6 Aug 2001 22:21:32 +0200
[followups to zope-dev]
Tommy,
You're right, I did the tests and it is indeed a Zope problem.
What happens is this. If you have:
<form action="/action?row=3" method="POST">
<input type="submit" name="submit" value="submit">
</form>
Then what gets sent by Mozilla to the web server is:
POST /action?row=3 HTTP/1.1
Host: ...
...
Content-Length: 13
submit=submit
And indeed there is enough information here to build a correct REQUEST
with both row=3 and submit=submit.
(However note that with a GET method, Mozilla sends:
GET /action?submit=submit HTTP/1.1
So the GET method wouldn't work here anyway.)
The culprit is ZPublisher.cgi.FieldStorage, who only looks at the
QUERY_STRING if it's a GET or a HEAD.
If everybody else does it, maybe Zope should do it...
A word about the spec: HTML-4.01 says:
* If the method is "get" and the action is an HTTP URI, the user agent
takes the value of action, appends a `?' to it, then appends the form
data set, encoded using the "application/x-www-form-urlencoded" content
type. The user agent then traverses the link to this URI. In this
scenario, form data are restricted to ASCII codes.
* If the method is "post" and the action is an HTTP URI, the user agent
conducts an HTTP "post" transaction using the value of the action
attribute and a message created according to the content type specified
by the enctype attribute.
So the "get" part isn't even clear, what happens if the action already
contains a '?'... the spec doesn't say. Note BTW that an URI with two
'?' wouldn't be legal.
Cheers,
Florent Guillaume
Nuxeo
> Florent,
>
> Ok, if it works in Coldfusion and ASP, then there isn't a problem with
> 1. My browser
> 2. HTTP spec
> 3. Development language
>
> But if, now, I try to do the exact same thing in Zope, and it doesn't work,
> then how could you NOT say that it isn't a Zope problem? I'm not totally
> assuming that Zope is the problem, (assumptions can be deadly), but if it
> has worked before, and doesn't work now with a new development language,
> then where is the first place one should look?
>
> I'd be interested in input from developers who may have done this in PHP or
> other languages. If it also works in them....
>
> The only thing that I can think of is if Zope parses differently from other
> languages. Meaning that if you choose to pass variables through the action
> property, then you MUST use Get rather than Post. In the other languages it
> didn't matter, but with Zope, it could potentially matter. I'll test it and
> write back.