iTP Secure WebServer System Administrator's Guide (iTPWebSvr 6.0+)
Using NonStop Servlets for JavaServer Pages
(NSJSP)
iTP Secure WebServer System Administrator’s Guide—523346-002
9-9
Web Archive (WAR) Files
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-3.
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 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
•
Add the context path in the iTP_server.xml file. Use the WAR file name, minus
the .war extension:
<Context path="/chat" docbase = "webapps/myapp1"> <\Context>
•
Add the Filemap directive to the servlet.config file:
Filemap /myapp1 $server_objectcode
•
Restart servlet.ssc and the iTPSecure WebServer to deploy the WAR file.
NonStop Servlets for JavaServer Pages
(NSJSP) Architecture
This subsection contains background information about the NonStop Servlets for
JavaServer Pages (NSJSP) architecture. It illustrates and discusses the relationships
between HTML clients, iTP Secure WebServer processes, and the web container
environment. It also describes the lifecycle of a servlet and the benefits of running
servlets in NonStop TS/MP server classes.
The iTP Secure WebServer implementation is a multi-threaded out-of-process servlet
container; a Java web container (with web applications) that runs in a Java Virtual
Machine (JVM) outside of the iTP Secure WebServer httpd process. This architecture
is shown in Figure 9-3, iTP Secure WebServer Servlet Architecture.
In essence, the iTP Secure WebServer provides the same JVM functionality as any
other J2EE implementation, but is unique in its ability to scale across multiple CPUs to
provide a NonStop computing environment.