NonStop Servlets for JSP System Administrator's Guide

Configuring NSJSP
NonStop Servlets for JavaServer Pages (NSJSP) System Administrator’s Guide525644-001
3-10
Configuring Web Applications
Initializing Servlets
You can initialize servlets in either of the two versions of the web.xml file.
If portability is a requirement, you may prefer to put the initialization within the
application version of web.xml. This is the deployment descriptor location used when
packing or unpacking web application archive (WAR) files.
The <init-param> element contains a name/value pair as initialization parameter of
the servlet, as shown in Example 3-8.
As noted previously, the servlet name is an alias of the servlet class name. The alias
allows you to change the name of the servlet class without having to make changes to
URL references to the servlet in the application. If you have no need of this feature,
use the same name in both places.
Configuring Web Applications
A web application is a collection of servlets, HTML pages, images, JavaServer Pages,
a deployment descriptor, and other configuration files all in one location. The web
application is organized as a structured hierarchy of directories that can be packaged
or unpackaged from a web application archive (WAR) file.
The directory structure has two parts:
A public area for resources such as HTML pages and images that can be used for
downloading to clients for directly rendering on the browser.
A private area with the root WEB-INF, which contains configuration files such as
the web.xml deployment descriptor, servlet classes and library files - resources
that require a managed lifecycle.
Example 3-9 shows a sample application directory structure on the NSK OSS:
Example 3-8. Initializing Servlets
<servlet>
<servlet-name>
your alias servlet name
</servlet-name>
<servlet-class>
your servlet class name
</servlet-class>
<init-param>
<param-name>name1</param-name>
<param-value>value1</param-value>
<param-name>name2</param-name>
<param-value>value2</param-value>
</init-param>
</servlet>