iTP Secure WebServer System Administrator's Guide (iTPWebSvr 5.1+)

Using NonStop Servlets for JavaServer Pages With
The iTP Secure WebServer
iTP Secure WebServer System Administrator’s Guide522659-001
9-9
The WEB-INF Subdirectory
The WEB-INF Subdirectory
The WEB-INF subdirectory contains private files, that is, files that cannot be directly
served to the user for rendering by the browser. These are typically java class files. To
deploy any servlets you must create the WEB-INF subdirectory. This directory contains
the /classes subdirectory where you store the compiled classes, the lib subdirectory and
your customized version of the web.xml file - the deployment descriptor.
webapps/myapp1/WEB-INF/web.xml
webapps/myapp1/WEB-INF/classes/helloworld.class
webapps/myapp1/WEB-INF/lib
A detailed description of the directory structure can be found in Application Directory
Structure (See page 9-23).
The Deployment Descriptor
There is a “default” version of web.xml that is used to set the base default contexts and
MIME types for all servlets, and can preload and start up servlets when the web
container is first started. If you have a custom web.xml file for your particular servlet or
JSP, as shown in the greetings application directory structure above, that version
overrides the default.
On the iTPWebServer, the default version of web.xml is located in the following
directory
/usr/tandem/webserver/servlet_jsp/conf
Web Archive (WAR) Files
The web application can be packaged into a web archive (WAR) file to provide a
simplified means of distributing Java class files and related resources as a single
deployment unit.
Assume we have the application /myapp1 as shown in Example 9-1
on page 9-4.
To create a WAR file, go to the root of the application - for example:
cd /servlet_jsp/webapps/myapp1
The following command will pack all the files and subdirectories into a single file called
myapp1.war. The -c option creates a new archive, the -f option specifies the target file
name (we used * to keep the same name) and a v (verbose) option will echo the files to
your display.
jar -cf myapp1.war *
To view the contents of an existing WAR file, use:
jar -tvf myapp1.war
To deploy a WAR file:
Place the WAR file in the /servlet_jsp/webapps directory