Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

servlet pblm

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI everybody
I am new to this forum.I have just started studing Head first servlets and Jsp. I have installed eclipse and downloaded tomcat. i even added tomcat plugin to eclipse.
I tried the first beer example.
when i tried to run i got

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).


--------------------------------------------------------------------------------

Apache Tomcat/5.0.28

error

please let me know where i am going wrong.

thanks a lot in advance
sunitha
 
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's telling you that you did not implement doPost in your servlet and the form you are submitting specified a method of "POST"
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your servlet, I believe you have only implemeted doGet(..) method. But In HTML form, you are submitting a form data using POST method, so when container calls a service() method of GenericServlet class, it tries to find doPost() method. (Because the type of request coming from browser is POST). But doPost() does not exist so you are getting that error.
 
I just had the craziest dream. This tiny ad was in it.
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic