Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP method GET is not supported by this URL

 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to run this simple progam and i have no idea why i am getting this eror since i am not even using "Get"
Can some one help meout in this.

form.html




DrinkSelect.java




web.xml
 
Pavan Tanay
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error are you getting?
 
Chinmaya Chowdary
Ranch Hand
Posts: 432
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nabila. Use
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use POST as the form method, not Post.

 
Salil Vverma
Ranch Hand
Posts: 257
Hibernate Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Nabila,

I think, with this code while clicking on submit button you might be getting an dialogue box with an option of save or open with. This is because of setting incorrect content type in your code ie


It should be "text/html". The below code would work fine with your jsp and web.xml entries -



I hope this would solve your problem.

 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ppl..
Its working!!
 
ruchilalla lallalalla
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the exact error and i resolved it by using HttpServletRequest instead of ServletRequest interface in doget and doPost




 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic