You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Roger L. Costello" <co...@mitre.org> on 2002/08/05 18:29:01 UTC

Tomcat support HTTP PUT? Do HTTP PUT from HTML?

Hi Folks,

I have two questions:

1. Does Tomcat 4.03 support HTTP PUT?

2. [A slightly off-topic question] Is there any way to do an HTTP PUT
from HTML?  I would like to have an HTML form that gets filled in by the
user.  Upon the user clicking the Submit button, some script kicks in to
harvest all the data in the HTML form, create an XML string using the
data, and then HTTP PUT the XML string to the Tomcat server.  I can 
write Javascript to harvest the HTML form data, and compose an XML
string.  However, I don't know how to then HTTP PUT the XML string to
the server.  Any ideas?  /Roger


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat support HTTP PUT? Do HTTP PUT from HTML?

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
> 1. Does Tomcat 4.03 support HTTP PUT?

Tomcat doesn't mind, since it is the job of particular HttpServlet to support PUT. See docs on HttpServlet and "doPut()"

> 2. [A slightly off-topic question] Is there any way to do an HTTP PUT
> from HTML?  I would like to have an HTML form that gets filled in by the
> user.  Upon the user clicking the Submit button, some script kicks in to
> harvest all the data in the HTML form, create an XML string using the
> data, and then HTTP PUT the XML string to the Tomcat server.  I can 
> write Javascript to harvest the HTML form data, and compose an XML
> string.  However, I don't know how to then HTTP PUT the XML string to
> the server.  Any ideas?  /Roger

The main usage of "PUT" HTTP method is to place an object on the server. HTML forms can use either "GET" or "POST" methods to submit their data. "PUT" is reserved for Web Authoring tools, like Netscape Composer.

Anyhow, today the prefered method for placing content on the web server is WebDAV, which is present in Tomcat and supported by at least Macromedia Dreamweaver, if not others, by now.

As for servlets writing into the WebApp directory tree, I guess they can do that (I haven't checket the specs, but if WebDAV servlet can do it, than any other servlet can). So, there is no need to play with "PUT", since you'll hardly see it from the client, the way you're going.

Nix.

RE: Tomcat support HTTP PUT? Do HTTP PUT from HTML?

Posted by Mike Jackson <mj...@cdi-hq.com>.
Maybe this is a stupid question, but why not just POST it?  I have something
that I did that generates XML and then just POSTs it to the web server, I
don't bother to try to read any parameters from it, I just read from the
input stream and parse the xml.  Seems fairly straight forward to me...

--mikej
-=-----
mike jackson
mjackson@cdi-hq.com

> -----Original Message-----
> From: Roger L. Costello [mailto:costello@mitre.org]
> Sent: Monday, August 05, 2002 9:29 AM
> To: Tomcat Users List
> Cc: Costello,Roger L.
> Subject: Tomcat support HTTP PUT? Do HTTP PUT from HTML?
>
>
> Hi Folks,
>
> I have two questions:
>
> 1. Does Tomcat 4.03 support HTTP PUT?
>
> 2. [A slightly off-topic question] Is there any way to do an HTTP PUT
> from HTML?  I would like to have an HTML form that gets filled in by the
> user.  Upon the user clicking the Submit button, some script kicks in to
> harvest all the data in the HTML form, create an XML string using the
> data, and then HTTP PUT the XML string to the Tomcat server.  I can
> write Javascript to harvest the HTML form data, and compose an XML
> string.  However, I don't know how to then HTTP PUT the XML string to
> the server.  Any ideas?  /Roger
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat support HTTP PUT? Do HTTP PUT from HTML?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 5 Aug 2002, Roger L. Costello wrote:

> Date: Mon, 05 Aug 2002 12:29:01 -0400
> From: Roger L. Costello <co...@mitre.org>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Cc: "Costello,Roger L." <co...@mitre.org>
> Subject: Tomcat support HTTP PUT?  Do HTTP PUT from HTML?
>
> Hi Folks,
>
> I have two questions:
>
> 1. Does Tomcat 4.03 support HTTP PUT?
>

Tomcat doesn't support it directly, but it's easy to make your servlet
support it -- just implement the doPut() method in HttpServlet.  For
example, the manager webapp in Tomcat 4.1.x uses PUT in the implementation
of the "deploy" command.

Note that browsers don't generally support being the client side of a PUT.

> 2. [A slightly off-topic question] Is there any way to do an HTTP PUT
> from HTML?  I would like to have an HTML form that gets filled in by the
> user.  Upon the user clicking the Submit button, some script kicks in to
> harvest all the data in the HTML form, create an XML string using the
> data, and then HTTP PUT the XML string to the Tomcat server.  I can
> write Javascript to harvest the HTML form data, and compose an XML
> string.  However, I don't know how to then HTTP PUT the XML string to
> the server.

It sounds like you want to program your browser to do the first part of
this -- unless you're writing an applet that looks like a challenge.

You are likely to be better off exploring the <input type="file"> element
that pops up a file browser for the user to pick which file to be
uploaded.  You'll need software at the server end for this as well -- two
good choices are the file upload stuff at www.servlets.com or the
commons-fileupload package nightly build at Jakarta.

>  Any ideas?  /Roger

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>