• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't use trace, put, delete methods on tomcat  RSS feed

 
Serghei Jelauc
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.
I can't use http methods trca, put, delete on tomcat. When I use trace for example in form the tomcat uses the default http get method.
May be I have to set up somethig in config files?

Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used PUT without any problem in Tomcat5 - see the docs for javax.servlet.http.HttpServlet. You will see the methods doTrace, doPut, doDelete and a number of others.
If you are not getting the expected result, I bet your request is not correctly formulated.
Bill
 
Serghei Jelauc
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be I do something wrong. Here is my small code:
html


servlet


When I click on the submit button, the next error ir occured:
"message HTTP method GET is not supported by this URL

description The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL)."
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


It is my understanding from looking at the HTML standard that form only supports GET and POST methods. That make sense since a form is for user input.
If you want a servlet to respond to other request types, use java.net.HttpURLConnection.setRequestMethod("TRACE");
A URL created with a string starting "http://" will give you a HttpURLConnection from the getConnection method.
Bill
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!