T
the_JAVA_Rookie
I just tried my 1st servlet program, but still have some trouble in Tomcat,
can someone tell me what I missed?
I have two class files (HelloWorld.class and Hello.class) located @
C:\Tomcat\webapps\ROOT\WEB-INF\classes\,
and below is the contents of web.xml located @ C:\Tomcat\webapps\ROOT\WEB-INF\,
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>
hi
</servlet-name>
<servlet-class>
HelloWorld
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>
hi
</servlet-name>
<url-pattern>
/hello.html
</url-pattern>
</servlet-mapping>
</web-app>
when I typed this http://localhost:8080/servlet/HelloWorld in IE,
I got this error message:
HTTP Status 404 - /servlet/HelloWorld
can someone tell me what I missed?
I have two class files (HelloWorld.class and Hello.class) located @
C:\Tomcat\webapps\ROOT\WEB-INF\classes\,
and below is the contents of web.xml located @ C:\Tomcat\webapps\ROOT\WEB-INF\,
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>
hi
</servlet-name>
<servlet-class>
HelloWorld
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>
hi
</servlet-name>
<url-pattern>
/hello.html
</url-pattern>
</servlet-mapping>
</web-app>
when I typed this http://localhost:8080/servlet/HelloWorld in IE,
I got this error message:
HTTP Status 404 - /servlet/HelloWorld