wood burning stoves 2.0*
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

arturo cruz
Greenhorn

Joined: Nov 16, 2011
Posts: 2
I am trying to run a servlet using tomcat 6 but cannot get past the HTTP method GET is not supported by this URL message. I have pasted below the servlet code, the web.xml and the directory structure.

Any help is appreciated.


******* the URL : http://localhost:8080/listenerTest/ListenTest.do

********** the directory structure ****************

webapps
listenerTest
WEB-INF
classes
com
example
** the servlet goes here****
***********the servlet ******************


************** Web.xml ************************


  • <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

    <description>
    JSP 2.0 Examples.
    </description>
    <display-name>JSP 2.0 Examples</display-name>

    <servlet>

    <servlet-name>listenerTester</servlet-name>

    <servlet-class>com.example.listenerTester</servlet-class>

    </servlet>

    <servlet-mapping>

    <servlet-name>listenerTester</servlet-name>

    <url-pattern>/ListenTest.do</url-pattern>


    </servlet-mapping>

    <context-param>

    <param-name>breed</param-name>
    <param-value>Great Dane</param-value>

    </context-param>


    <listener>
    <listener-class>
    com.example.myServletContextListener
    </listener-class>

    </listener>


    </web-app>

  • Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61417
        
      67

    Check your spelling.


    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    sagar kumar nerella
    Greenhorn

    Joined: Jul 09, 2011
    Posts: 18

    hi

    from examining your code posted at the very first glance it is clear that the method should be named doGet() not goGet() .

    try this change if it doesn't works then try with the using the post method.


    sagar kumar nerella,
    java certified professional
    arturo cruz
    Greenhorn

    Joined: Nov 16, 2011
    Posts: 2
    That was the problem. doGet was mispelled as goGet. Amazing how I looked at the mehod name and didn't catch it.

    Thank you Sagar and Bear.

    Tim Moores
    Rancher

    Joined: Sep 21, 2011
    Posts: 2408
    An excellent example of why you need to get into the habit of using the @Override annotation.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: HTTP method GET is not supported by this URL