NonStop Servlets for JSP System Administrator's Guide
Overview and Architecture
NonStop Servlets for JavaServer Pages (NSJSP) System Administrator’s Guide—525644-001
1-6
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 4-1, Use of
getAttribute() Method to Obtain Environment Variables, on page 4-6. To create a WAR
file, go to the root of the application. For example:
cd /usr/tandem/webserver/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:
1. Place the WAR file in the /servlet_jsp/webapps directory
2. Add the context path in the iTP_server.xml file. Use the WAR file name, minus
the .war extension:
<Context path="/chat" docbase = "myapp1"> </Context>
3. Add the Filemap directive to the servlet.config file:
Filemap /chat $server_objectcode
4. Restart servlet.ssc and the iTP Secure WebServer to deploy the WAR file.
JavaServer Pages (JSP) Architecture
This overview of the main features of JavaServer Pages discusses
•
The reasons for using distributed servlets
•
How to include one servlet in another
•
How to forward responses between servlets
Simple examples of JSP code are annotated.
A general introduction to JSP is given in JavaServer Pages (JSP) on page 1-4. This
section introduces implementation, models, and syntax basics. For full details consult
the Sun Microsystems Java website, java.sun.com.
Typically, JSP pages are subject to a translation phase and a request processing
phase. The translation phase is carried out once (unless the page changes) when the