NonStop Servlets for JSP System Administrator's Guide
Configuring NSJSP
NonStop Servlets for JavaServer Pages (NSJSP) System Administrator’s Guide—525644-001
3-13
Create a New Application
properties for the corresponding context or unless you do not want to add an extra
NSJSP root directory (/servlet_jsp) when accessing a web application.
Create a New Application
If you are creating a new application using the iTP WebServer environment you
should:
1. Create the appropriate directory structure under /webapps. If you prefer to locate
it elsewhere, use the docbase attribute of the context path. Populate it with the
required servlets and JSP files.
2. Create a local version of the web.xml file for deployment descriptors. You could
write the deployment descriptors in the main default web.xml file, but that would
make it difficult to create a WAR file later on (only the local version of web.xml
becomes part of the WAR file).
3. Create the context path in iTP_server.xml.
4. Add a filemap to servlet.config corresponding to the application name.
5. Restart the NSJSP process.
Compile a Servlet
To compile a servlet in the NSJSP web container, include the following JAR file in your
OSS environment variable CLASSPATH:
/usr/tandem/webserver/servlet_jsp/common/lib/servlet.jar
Assuming that you are now using the expected source code location of
. ./webapps/yourapplicationname/WEB-INF/src
enter the following command to compile the servlet:
javac -d ../WEB-INF/classes/ *.java
(where * is the servlet name). This command will compile the Java files and create the
class files under /WEB-INF/classes.
Deploy a Servlet
Enter a servlet and class name in the deployment descriptor. You can use the same
name for servlet and class names, or you can use the servlet name as an alias in a
URL rather than revealing the whole servlet class name. Thus, in Example 3-10, the
URL would be able to refer to start rather than startCartRequest.
The deployment descriptor is located in the web.xml file at the top level of your
application directory in /webapps/WEB-INF/.
A fragment of that file is shown in Example 3-10: