Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (282.76 KB, 3 trang )
Show
Deploying a Servlet in TomCat
In this document we walk you through all the steps you must take to deploy the sample Servlet into TomCat 3.2.3 Servlet Container.
The steps involved
1. Preparation
2. Deploy the example
3. Run the example
4. Setting Up the Environment
Preparation
1. Copy the provided ExcelCalculator.html, and ExcelCalculatorExample.java files into a local directory that will be the target directory of your deployment. These files
are included in your jintegra\examples\servlet-com\ServletToExcelCalculator directory when you download J-Integra®.
2. Include jintegra.jar, and excel.jar into your CLASSPATH environment variable.
3. Go to the local directory in which you copied ExcelCalculatorExample.java, and enter the following command to compile it:
javac ExcelCalculatorExample.java
Deploy the example
This section explains how you can run the ExcelCalculatorExample on Jakarta TomCat 3.2.3. Because this example Servlet is using jintegra.jar and excel.jar, you need
to set the CLASSPATH environment variable so that the Tomcat Servlet Container will find the classes it needs. You can either create a batch file that sets the
CLASSPATH or you can modify the TomCat's startup.bat to include your CLASSPATH.
Another issue is the authentication library. On an NT machine, you need to be authenticated in order to have access to a COM object. J-Integra® comes with a native
library that authenticates you automatically. The native library is located in jintegra/bin. You must add this path to your PATH environment variable. Again, either you can
write a batch file to set this one or modify TomCat's startup.bat to do the job. After you have finished compiling the proxy files and the ExcelCalculatorExample.java, you
are ready to deploy the Servlet.
1. Ensure that you have you have installed the J-Integra® license.
2. Create the deployment directory: Create a directory called ExcelExample in the webapps directory of your TomCat folder. In the ExcelExample directory, create two
directories named META-INF and WEB-INF. In the WEB-INF directory create a directory named classes. Now you should have a directory structure that looks like
this:
3. Create the XML descriptor: Here is the sample XML descriptor you can use to deploy this example. Save this file as web.xml in the WEB-INF directory.
This file is included in your jintegra\examples\servlet-com\ServletToExcelCalculator directory (named web.xml) when you download J-Integra®.
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' '
<
web-app>