This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Using Put request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Using Put request" Watch "Using Put request" New topic
Author

Using Put request

Renu Radhika
Ranch Hand

Joined: Oct 21, 2005
Posts: 243
How can I use put request?Can I give the method in form as put?In that case how will I send the resource, which I want to put on the server?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
PUT and DELETE can not be used with forms. For some further information, have a look here and here.


Ping & DNS - my free Android networking tools app
Renu Radhika
Ranch Hand

Joined: Oct 21, 2005
Posts: 243
That means I cant send a put request to the server?How else can I send a document to the server?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
You can most definitely use PUT, just not from inside an HTML form. As the articles I linked to mention, there are several options for the client side, e.g. Jakarta Commons HttpClient (or even java.net.HttpUrlConnection) or the XmlHttpRequest in JavaScript (although JavaScript can't interact with files, of course). On the server side you can use the standard servlet API (the HttpServlet class has doXYZ methods for all HTTP methods, including PUT and DELETE).

Other ways of handling files on the server would be WebDAV, which is shipped with Tomcat, or the standard HTTP file upload described here.
[ January 03, 2007: Message edited by: Ulf Dittmer ]
 
GeeCON Prague 2014
 
subject: Using Put request