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>