• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat error.

 
Sen Aff
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was trying the tutorial in HFSJ, page 168.

When i tried to access the servlet from the URL, just as it is
demonstrated on page 177, i got a Tomcat error.

The error says:
HTTP method GET is not supported by this URL
(i was not even using GET, I used POST)

However, when i access the servlet using an HTML page, it works fine.

Can anyone explain to me why this discrepancies.

Thank you very much for your time.

Sen Aff.
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The error says:
HTTP method GET is not supported by this URL
(i was not even using GET, I used POST)



If there is GET request, your servlet must override the doGet(...) method
and same applies to http POST request too as you have to override doPost(...)
method in your servlet if there is POST request.


Thanks,
[ June 03, 2007: Message edited by: Chandra Bhatt ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was not even using GET, I used POST

If you tried to access it by typing the URL in the address bar, then it's a GET, not a POST.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic