NonStop Servlets for JavaServer Pages (5.0) System Administrator's Guide
Overview and Architecture
NonStop Servlets for JavaServer Pages (NSJSP) System Administrator’s Guide—525644-002
1-7
JavaServer Pages (JSP) Architecture
For example, to create a WAR file for the application /myapp1 go to the root of the
application.
cd /usr/tandem/webserver/servlet_jsp/webapps/myapp1
The following command packs 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 the -v (verbose) option echoes the files to your display.
jar -cf myapp1.war *
To view the contents of an existing WAR file, type:
jar -tvf myapp1.war
To deploy a WAR file, see Add a New Web Application on page 3-15.
JavaServer Pages (JSP) Architecture
This subsection discusses
•
The reasons for using distributed servlets
•
How to include one servlet within 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, http://java.sun.com/products/jsp.
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
JSP page is requested for the first time or when it is precompiled. The result is a JSP
page implementation class file that implements the servlet interface.
The JSP page implementation class file extends HttpJspBase, which in turn
implements the servlet interface. The service method of this class, _jspService(),
essentially inlines the contents of the JSP page. Although the _jspService cannot
be overridden, you can handle initialize and destroy events by providing
implementations for the jspInit() and jspDestroy() methods within your own
pages. When the class file is loaded within the web container, the _jspService()
method replies to a client request. By default, the _jspService() method is
dispatched on a separate thread by the web container when processing concurrent
client requests.
Model-View-Controller Designs
There are two design philosophies for JSP usage. The approaches differ in terms of
where most of the processing takes place. In the first approach, shown in Figure 1-3, A
Basic NSJSP Model, the incoming request from a web browser is sent directly to the