• Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP Status 405 - HTTP method GET is not supported by this URL  RSS feed

 
Govinda Krishna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
i ve written a simple servlet example which displays a message "Hello world".
i am using Tomcat 6.
when i run that servlet as
http://localhost:9090/Temp/tempServlet
i got error
HTTP Status 405 - HTTP method GET is not supported by this URL


can any one tell me wats going on there.
thanks in advance.

govinda
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Which methods does the servlet have - did you override the doGet method?
 
Govinda Krishna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i haven't written but its not mandatory to ovverride doGet() and doPost() methods
 
Govinda Krishna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyway this is my code

package servlets;


[BSouther: Added UBB CODE tags]
[ January 29, 2008: Message edited by: Ben Souther ]
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're correct that you are not required to override to override doGet or doPost, however, that is how you implement servlets. You should not override "service"; see here for more details.

You should definitely not call super.service (or super.doGet or super.doPost in the other methods).
 
Govinda Krishna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply...

really its working fine if i remove the call super.service().
then what is the problem if call like that. i couldn't understand.
can you tell me what is happening there.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Govinda",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Govinda:
can you tell me what is happening there.

The base methods are there to say "not supported" if you don't override them. By calling them explicitly, you are running the code that says "I'm not supported". Why would you do that?
 
Govinda Krishna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks alot..
now i came to know what is happening...
thank you once again for your responses..

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!