aspose file tools*
The moose likes Servlets and the fly likes HTTP method GET is not supported by this URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTTP method GET is not supported by this URL" Watch "HTTP method GET is not supported by this URL" New topic
Author

HTTP method GET is not supported by this URL

Narasimha Raju Naidu
Ranch Hand

Joined: Mar 23, 2007
Posts: 37
hi 2 all,

i am getting the above problem while running my servlet on tomcat 6.0 server

my code:

url: http://localhost:8086/Suji/stu


web.xml file


the response what i am getting is



can any one tell me where i am doing mistake. waiting for yout valuable replies.

Regards,

Narasimha Raju
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The big thing to remember is that Java is a case sensitive language.

There is no "Service" method (with an upper case S).
So you haven't overridden any of the required methods needed to support a GET request.

Also, overriding the service method is not a good idea (except in rare cases). It is better to explicitly override doGet and doPost.
If you want the same code to handle both methods, have one call the other or have them both call a user defined method of your own.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Nhat Nguyen
Greenhorn

Joined: Jan 09, 2008
Posts: 9

public void Service(ServletRequest req,ServletResponse res) throws ServletException,IOException

this method must be:

or better:
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: HTTP method GET is not supported by this URL