When you deploy a web module to a Tomcat server or execute the web module, the IDE adds a Context element to the server's configuration file (server.xml), if one does not already exist. This Context element declares that, when the server is started, the server must load the web module with the properties specified in the Context element.
The IDE uses the Context Root property value from the WEB-INF property sheet to set the path attribute in the Context element. This path becomes the context root that the Servlet engine creates for the web module. The context root is the path to the web module. For example, if the Context Root property value is /directives, then a resource named index.html under the web module's root can be accessed using the URL http://host:port/directives/index.html.When the server receives the HTTP request, the server selects the web module for processing the request by matching the longest possible prefix of the Request URI against the context path of each defined Context. You can define an unlimited number of Context elements within a particular Host, and you can define more than one Context element for a web module. Each Context must have a unique context path.
Typically, because the IDE adds context elements automatically, you do not need to create context elements explicitly. However, if you should choose to do so, perform the following steps.
To deploy a web module by adding a Context element:
See Also | |
---|---|
Tomcat Context Node Setting Context Properties Deleting a Context |