本文发表在 rolia.net 枫下论坛I installed Tomcat 4.1 standalone server on my windown 2000 machine. It serves the webpages fine but did not serve the servlet. It always says that the request resource is not avaiable.
1) I set it up use the following configuration:
1. a ) CATALINA_HOME = C:\Tomcat 4.1
1.b) CLASSPATH = %CLASSPATH%;C:\Tomcat 4.1\common\lib\servlet.jar
1. c) JAVA_HOME = C:\jdk1.3.1_01
2) create an servlet in the following directory such as:
webapps/chapter01/WEB-INF/classes/HelloWorld.class
3) for the web.xml under /WEB-INF
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>HelloWorldExample</servlet-name>
<servlet-class>HelloWorldExample</servlet-class>
</servlet>
</web-app>
I do not know what wents wrong. But If I put this class file in the examples directory . It is comes with the installation. It works fine.
Can anybody give me some clues. Your help will be great appreciated.更多精彩文章及讨论,请光临枫下论坛 rolia.net
1) I set it up use the following configuration:
1. a ) CATALINA_HOME = C:\Tomcat 4.1
1.b) CLASSPATH = %CLASSPATH%;C:\Tomcat 4.1\common\lib\servlet.jar
1. c) JAVA_HOME = C:\jdk1.3.1_01
2) create an servlet in the following directory such as:
webapps/chapter01/WEB-INF/classes/HelloWorld.class
3) for the web.xml under /WEB-INF
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>HelloWorldExample</servlet-name>
<servlet-class>HelloWorldExample</servlet-class>
</servlet>
</web-app>
I do not know what wents wrong. But If I put this class file in the examples directory . It is comes with the installation. It works fine.
Can anybody give me some clues. Your help will be great appreciated.更多精彩文章及讨论,请光临枫下论坛 rolia.net