iTP Secure WebServer System Administrator's Guide (iTPWebSvr 6.0+)

Using NonStop Servlets for JavaServer Pages
(NSJSP)
iTP Secure WebServer System Administrator’s Guide523346-002
9-26
Deploy an Existing Application WAR file
Deploy an Existing Application WAR file
If you already have a fully developed application in a WAR file, move the WAR file to
the webapps directory, create the context path in iTP_server.xml, add a filemap in
servlet.config and restart the web container (the NSJSP process). This will
automatically deploy the application. The container uses the WAR file name (minus
extension) as the context and creates a directory of the same name.
Create a New Application
If you are creating a new application using the iTPWebServer environment you should:
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.
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).
Create the context path in iTP_server.xml
Add a filemap to servlet.config corresponding to the application name
Restart the NSJSP process
Compile a Servlet
To be able to compile a servlet in the NSJSP web container you should have the
following JAR file included in your OSS environment variable CLASSPATH:
/usr/tandem/java/jre/lib/iTP_Servlet_JSP.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 the servlet name may be used as an alias in a
URL rather than revealing the whole servlet class name. Thus, in the example below
the URL would be able to refer to start rather than startCartRequest.
The deployment descriptor is usually located in web.xml file at the top level of your
application directory in /webapps/WEB-INF/.