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

Problem in HFSJ Ch3,help~~

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I work with win2000,Tomcat 5.5.17,JDK5.0_9

I have trouble at "The first version of the controller servlet".
When I "compiling,deploy,and test the controller servlet",hitting the "Submit",there always a http 405 error,it prints:

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).
 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

HTTP Status 405 - HTTP method POST is not supported by this URL


this means your servlet has a doGet( ) method and your request wants a POST method ( the action attribute of html's form tag is asking for method="post)

maku sure you add this in your servlet



hth
 
Kidd He
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Niranjan Deshpande:

this means your servlet has a doGet( ) method and your request wants a POST method ( the action attribute of html's form tag is asking for method="post)

maku sure you add this in your servlet



hth



Thanks Niranjan !!!
I found I wrote the method "doPost" in the wrong way----"dopost".I should be more careful.
 
The fastest and most reliable components of any system are those that are not there. Tiny ad:
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