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-25
Add a New Web Application
A sample application directory structure (on the NSK OSS) is shown below:
/webapps/myapp1/
index.html
login.jsp
images/
companylogo.gif
ourfounder.gif
literature/
whitepaper.pdf
WEB-INF/
web.xml
classes/
shoppingcart.class
checkout.class
lib/
xmltools.jar
src/
shoppingcart.java
checkout.java
In the example myapp1 there is a public area with files that are directly accessible for
rendering by the browser, for example, the gif and html files. Although JSP files cannot
be directly rendered, the API considers them the same as HTML files and allows them
to be located in the public area. Similarly the java source files cannot be rendered, but
can nevertheless be located in this public area - although in our examples, for security,
we locate them within the WEB-INF subdirectory.
The WEB-INF area is controlled by the web container which forwards requests to the
servlets and JSP files from the iTPWebServer.
The web container method of organizing and controlling files has numerous
advantages over the previous "servlet engine" methods.
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.
Add a New Web Application
There are two ways to add an application to a run-time production system such as the
iTPWebServer.
Deploy an Existing Application WAR file on page 9-26
Create a New Application on page 9-26