Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
18
Chapter 1 Overview of Servlets and JavaServer Pages
Compile and Install Your Servlets
Once you've properly set your
CLASSPATH
, as described earlier in this sec
tion, just use
javac ServletName.java
to compile a servlet. The result
ant class file needs to go in a location that the server knows to check during
execution. As you might expect, this location varies from server to server. Fol
lowing is a quick summary of the locations used by the latest releases of Tom
cat, the JSWDK, and the Java Web Server. In all three cases, assume
install_dir
is the server's main installation directory.
Tomcat
install_dir/webpages/WEB INF/classes
Standard location for servlet classes.
utorial/
install_dir/classes
vailble at
Alternate location for servlet classes.
cat T
install_dir/lib
om
Location for JAR files containing classes.
omcat are a /Apache T
Tomcat 3.1
or T m
Just before this book went to press, Apache released a beta version of
ons f
Tomcat 3.1. If there is a final version of this version available when you go to
recti
download Tomcat, you should use it. Here is the new directory organization
that Tomcat 3.1 uses:
.coreservlets.cow
install_dir/webapps/ROOT/WEB INF/classes
Standard location for servlet classes.
TE: Updated di
install_dir/classes
NO http://ww
Alternate location for servlet classes.
install_dir/lib
Location for JAR files containing classes.
The JSWDK
install_dir/webpages/WEB INF/servlets
Standard location for servlet classes.
install_dir/classes
Alternate location for servlet classes.
install_dir/lib
Location for JAR files containing classes.
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved