Tomcat’s Directory Structure
For writing JSP pages, it’s not strictly necessary to be familiar with the hierarchy of Tomcat’s directory layout. But it certainly doesn’t hurt, so change location into the Tomcat root directory and have a look around. You’ll find a number of standard directories, which are described in the following discussion, grouped by function. Note that your installation layout may not be exactly as described here. Some distribution formats omit a few of the directories, and the logs and work directories might not be created until you’ve started Tomcat for the first time.
Application Directories
From the point of view of an application developer, the webapps directory is the most important part of Tomcat’s directory hierarchy. Each application context has its own directory, which is placed within the webapps directory under the Tomcat root.
Tomcat processes client requests by mapping them onto locations under the webapps directory. For a request that begins with the name of a directory located under webapps, Tomcat looks for the appropriate page within that directory. For example, Tomcat serves the following two requests using the index.html and test.jsp pages in the mcb directory:
http://localhost:8080/mcb/index.html http://localhost:8080/mcb/test.jsp
For requests that don’t begin with the name of a webapps subdirectory, Tomcat serves them from a special subdirectory named ROOT, which provides the default application context.[23]For the following request, Tomcat serves ...
Get MySQL Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.