• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HTTP method GET is not supported by this URL

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>

  •  
    Sheriff
    Posts: 67746
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Likes 2
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Check your spelling.
     
    Greenhorn
    Posts: 18
    Tomcat Server Notepad Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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.
     
    arturo cruz
    Greenhorn
    Posts: 2
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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.

     
    Saloon Keeper
    Posts: 7585
    176
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    An excellent example of why you need to get into the habit of using the @Override annotation.
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic