Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tomcat and Form Servlet

 
P. Sagdeo
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I moved on past simple java related errors. Thanks to all who helped me. Now when I use the html code:
to post to my new, improved HelloWorld,, I get this error from Tomcat
HTTP Status 405 - HTTP method POST is not supported by this URL
--------------------------------------------------------------------------------
type Status report
message HTTP method POST is not supported by this URL
description The specified HTTP method is not allowed for the requested resource (HTTP method POST is not supported by this URL).

--------------------------------------------------------------------------------
Java Web Services Developer Pack/1.3

Thanks,
Parth
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change your method from doGet to doPost..
Njoy
Praful
 
Pushkal Mishra
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally, you always do something like this in your servlet class:
--------------------------------
public void doGet(HttpServletRequest request, HttpServletResponse response) {
// do Something
}
public void doPost(HttpServletRequest request, HttpServletResponse response) {
doGet(request, reponse);
}
--------------------------------
meaning keep both the doGet() and doPost() methods and let one call the other. This way, the both the get and post requests may be handled. Of course, this holds true provided there is no distinction in your Servlet code on the basis oof request method.
Thanks,
Pushkal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!