Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress Servlet Development Guide

4.6 Create a Context Directory

Servlet contexts must be placed in the Agent directory <installdir>\apps\servlets. Each directory beneath <installdir>\apps\servlets defines a context. To create a new servlet context, simply create a new subdirectory under <installdir>\apps\servlets.

For example, to create a context named myapp, create a directory with that name under <installdir>\apps\servlets. Create a WEB-INF directory under myapp, and the context directory structure is complete. Before starting the container, create a web.xml file in the WEB-INF directory. The final directory structure is shown below:

In this example, the servlets directory contains a single context directory named myapp. At Agent startup, the container is initialized and creates a context named myapp and configures the context as specified in the <installdir>\apps\servlets\myapp\WEB-INF\web.xml file.

The servlets directory may contain any number of servlet contexts. Each context contains static Web pages and/or servlet definitions. Each context must also have its own web.xml file, describing which servlets are available within that context. Such a collection of contexts can be considered a Web application.


If using an external Web server, it must be configured to forward requests for the new context. See
Section 4.13 for details.

A HydraExpress web.xml file closely resembles a Java servlet web.xml file. The root element of the file is the web-app element, as shown below:

All other configuration elements within the file must appear within the web-app element. The rest of this chapter covers the contents of the context web.xml file in detail.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.