C:drive. (The actual location doesn't matter.)
jakarta-tomcat-3.2.4. JAVA_HOME environment variable JAVA_HOME to C:\JBuilder5\jdk1.3.1, or
wherever jdk1.3.1 is located on your machine.
You can set environment variables either in
Settings->ControlPanel->System->Environment or in a Command Prompt window.
When a environment variable is set in a Command Prompt window, that setting
applies only to that window.
When setting environment variables, do not use
quotatation marks and do not put spaces around the equal sign when using the
set command in a Command Prompt window. For example, to set
JAVA_HOME, write
set JAVA_HOME=C:\JBuilder5\jdk1.3.1
bin subdirectory of the Tomcat directory and run
the startup command.
In my case,
cd C:\jakarta-tomcat-3.2.4\bin
startup
TOMCAT_HOME to the Tomcat home directory, in my case to
C:\jakarta-tomcat-3.2.4%TOMCAT_HOME%TOMCAT_HOME
environment variable.)
CLASSPATH
to include %TOMCAT_HOME%\lib\servlet.jar.localhost:8080. (By default Tomcat listens on port 8080.)
examples/servlets/index.html.
When Tomcat sees a URL, it consults its server.xml file (which is
in %TOMCAT_HOME%/conf%TOMCAT_HOME%/conf/server.xml
<Context path="/examples"
docBase="webapps/examples"
crossContext="false"
debug="0"
reloadable="true" >
</Context>
This is a mapping from a URL address path to an internal location.
path attribute defines /examples as a URL address
which should be mapped to a special place on the disk and which may be associated
with a Servlet.
docBase attribute defines webapps/examples as the
place on the disk to associate with the path /examples.
<Context> tag tells Tomcat to map
http://localhost:8080/examples/ to
So when the user asks for%TOMCAT_HOME%/webapps/examples/
http://localhost:8080/examples/servlets/index.html
Tomcat actually access the file %TOMCAT_HOME%/webapps/examples/servets/index.html
examples directory as a subdirectory of
%TOMCAT_HOME%/webappsexamples directory has a
servlets subdirectly, which has an index.html file
in it. ../servlet/HelloWorldExample. On first glance, this looks
like it should be referring to a file at
%TOMCAT_HOME%/webapps/examples/servlet/HelloWorldExample%TOMCAT_HOME%/webapps/examples/servlet/servlet
directory at the top level of a mapped webapp address means: execute the
indicated servlet. In this case, execute the servlet called
HelloWorldExample.
.class files, i.e., compiled .java files.
WEB-INF/classes.class files for the
examples web app is stored in
%TOMCAT_HOME%/webapps/examples/WEB-INF/classeshttp://localhost:8080/examples/servlet/HelloWorldExampleTomcat runs
%TOMCAT_HOME%/webapps/examples/WEB-INF/classes/HelloWorldExample.class
HelloWorld.java from http://archive.corewebprogramming.com/Chapter19.html
to anywhere.
HelloWorld.java and compile it with javac HelloWorld.java
.class file to
%TOMCAT_HOME%/webapps/examples/WEB-INF/classes%TOMCAT_HOME%/webapps/examples/WEB-INF/classesContext entry to the server.xml file. Had we done that, we would have had to
restart Tomcat. To restart Tomcat, call shutdown and then startup again in
the Command Prompt window in which we had originally started Tomcat.)