[Top] [Prev] [Next] [Bottom]
Installing and Running the Example Applications
The example applications described in this tutorial are packaged so that they can be easily installed and run on the Tomcat JSP and server implementation. To run the examples:
- Download and install Tomcat
- Download the example applications
- The complete binary and source code for three of the examples are packaged in the Web application archives
helloworld.war, hellouser.war, and email.war, contained in the zip archive examples.zip. To install the applications in Tomcat, download examples.zip into the directory TOMCAT_HOME/webapps and unzip the archive. The fourth example, number guess, is already installed in Tomcat in the directory TOMCAT_HOME/webapps/examples/jsp/num.
- Configure Tomcat for the example applications
- When an archived Web application is accessed, Tomcat 3.2 automatically unpacks it into the directory TOMCAT_HOME/
webapps/appName and adds the context for each archive to the server startup file. If you are using an earlier version of Tomcat you will need to:
- Unpack the Web application archive with the command
jar xvf appName.war.
- Add the following line to the file TOMCAT_HOME
/conf/server.xml for each application:
<Context path="/appName" docBase="webapps/appName" debug="0" reloadable="true" />
- When a Web application archive is unpacked, its contents are deposited into the directories listed in the following table. This directory layout is required by the Java Servlet specification and is one that you usually will use while developing an application.
Directory
|
Contents
|
appName
|
JSP, HTML, and image files
|
appName/WEB-INF/classes
|
classes accessed by JSP files
|
- Open the URL of the first page of each example in a Web browser:
[Top] [Prev] [Next] [Bottom]
Copyright © 2000, Sun Microsystems, Inc. All rights
reserved.
|
|