NonStop Servlets for JSP System Administrator's Guide

Configuring NSJSP
NonStop Servlets for JavaServer Pages (NSJSP) System Administrator’s Guide525644-001
3-11
Configuring Web Applications
In the example myapp1, a public area contains the 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 iTP WebServer.
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 and a filemap to the servlet.config file, if required.
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.
Example 3-9. Application Directory Structure
/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