• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

HTTP method GET is not supported by this URL  RSS feed

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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


this method must be:


public void service(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException


or better:


public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!