Mark Thomas wrote:
On 02/05/2010 12:54, Bytecode wrote:
Thanks for all the answers. But it still isn't clear to me what Tomcat guys are referring
to by a "FORM URL." Looks like this term isn't defined anywhere else in the
docs.
Read section 3.1.1 of the Servlet 3.0 specification.
..which does not really use the words "FORM URL" either.
The closest seems to be :
...
3. The content type is application/x-www-form-urlencoded.
...
Ok, so then (but this is HTTP stuff, not specific to Tomcat) :
- we are anyway talking about a POST request (servlet spec 3.1.1)
- a POST request always contains a body, and the "parameters" are sent
in that body
- depending on the content-type of the POST request, this body content
(and thus the parameters) can be presented in 1 of 2 formats :
a) if the content-type is "application/x-www-form-urlencoded", then
the content (parameters) will consist of one long string, of the form
"name1=value1&name2=value2....[&nameN=valueN]"
and this string will be "url-encoded"
(This is the default when the html <form> tag does not have an "encType"
attribute.)
b) if the content-type is "multipart/form-data", then the content is
constituted of multiple "parts", each part looking approximately like an
RFC822 multi-part email part (each with its own header and body). Each
part represent one of the POST "parameters" (in effect, one <input> tag
of the posted <form>).
(For this format to be used by the browser sending the POST, the <form>
tag must have a encType="multipart/form-data" attribute.)
I have always found it strange (but it is so in the servlet spec and in
Tomcat) that the only POST format really described and processed by
Tomcat itself, is the first one (a) above.
In other words, when using (b) (which is a more natural and solid one
for file uploads), the application itself is responsible for reading and
parsing the content body.
(*)
So, I guess that when the Tomcat documentation is using the term "FORM
URL", it really means "a POST body with a content-type
application/x-www-form-urlencoded".
(*)
There exists a "FileUpload" module for that in the Apache commons
project (at http://commons.apache.org/fileupload/), but you have to
install it separately.
It would seem more natural to me if this module was an integral part of
Tomcat, but I suppose there are reasons why this is not so.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org