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

Using NonStop Servlets for JavaServer Pages With
The iTP Secure WebServer
iTP Secure WebServer System Administrator’s Guide522659-001
9-24
How to Add a New Web Application
The web container knows where to look for your classes if you use this application
directory structure. You do not need to add classes and JAR files explicitly to the
CLASSPATH. Each application can be managed separately from others in the container.
To add an application, just add the context to the server configuration file
iTP_server.xml.
Each application now has its own document root, and is consequently the start of the
context path to resources such as servlets in that application.
How to Add a New Web Application
There are two ways to add an application to a run-time production system such as the
iTPWebServer.
To 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 NonStop Servlets for JavaServer Pages
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.
To 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 NonStop Servlets for JavaServer Pages process
Compiling a Servlet
To be able to compile a servlet in the NonStop Servlets for JavaServer Pages 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