| Author |
HTTP method GET is not supported by this URL
|
Kenneth Kristiansen
Greenhorn
Joined: Mar 01, 2011
Posts: 2
|
|
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
Rancher
Joined: Apr 07, 2010
Posts: 1041
|
|
Hi Kenneth,
What is your directory structure? and what is the URL you are using?
Regards,
Frits
|
 |
Kenneth Kristiansen
Greenhorn
Joined: Mar 01, 2011
Posts: 2
|
|
im using tomcat..
Url: http://localhost:8080/webtek/test
|
 |
Jelle Klap
Bartender
Joined: Mar 10, 2008
Posts: 1409
|
|
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
|
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
|
 |
 |
|
|
subject: HTTP method GET is not supported by this URL
|
|
|