File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP method GET is not supported by this URL

 
Kenneth Kristiansen
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Im new at Servlets and ive created a simpel servlet called Test.
Ive got a xml file called web.xml.

When i run the servlet in Tomcat i got this error:

The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL)

Thanks

KenKri



b]Test.java:[/b]





 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2165
57
Android Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kenneth,

What is your directory structure? and what is the URL you are using?

Regards,
Frits
 
Kenneth Kristiansen
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im using tomcat..
Url: http://localhost:8080/webtek/test
 
Jelle Klap
Bartender
Posts: 1951
7
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your web.xml isn't valid, but I assume that's a copy-paste error.
The problem is in the method signatures of doGet() and doPost().
You've reversed the order of the parameters. That means that these methods are not valid overrides.
If you annotate methods that are supposed to override a method of a superclass, you should always add the @Override annotation.
It will help you catch stuff like this really easily at compile time
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic