The "directory structure" of Tomcat profile

Source: Internet
Author: User

Tomcat structure of the directory

(1) Installation of Tomcat

In fact, there is not much difference between the Tomcat,win32 version and the Linux version written entirely by Java, such as the Linux version, and there is no problem with Solaris. Here, the main example is the Win32 version.

Note: Before installing using Tomcat, install the JDK first, preferably Sun's JDK 1.2 or later.

(2) Tomcat directory structure

First, download the Jakarta-tomcat.zip package and unzip it into a directory, such as "C:\tomcat". At this point, you get the following Tomcat directory structure:

---Jakarta-tomcat

| ---Bin Tomcat Execution Script directory

| ---Common to place some generic classes ( such as JDBC drivers, etc.)

| ---Conf Tomcat configuration file

| ---Doc Tomcat documentation

| ---Lib Tomcat runtime required library file (JARS)

| ---Logs Tomcat execution log file

| ---src Tomcat source code

| ---WebApps Tomcat's main Web publishing directory (store our own Jsp,servlet, Class)

| --Work Tomcat's working directory, where Tomcat will translate the JSP file into the Java file and the class file.

Directory Name

General function Description of files in this directory

Bin

Contains Startup.bat (boot server) and Shutdown.bat (shutdown server) files

Conf

A settings file that contains the initial values of the variables that are set up to deploy Web apps on Tomcat, including server.xml (Tomcat global configuration file) and XML . (a file that sets default values for different tomcat-configured web Apps)

Doc

Contains a wide variety of documents about Tomcat.

Common

In its Lib directory, it mainly stores drivers such as JDBC.

Lib

Contains a variety of jar files used by Tomcat. On UNIX, any files in this directory will be appended to Tomcat's classpath.

Logs

Tomcat's log file.

Src

The source file for the Servlet API.

WebApps

Programs that contain Web apps (JSPs, Servlets, JavaBean, and so on)

Work

Automatically generated by Tomcat, which is where Tomcat places the intermediate (intermediate) files (such as compiled JSP files) during its run. If you delete this directory when Tomcat is running, you will not be able to execute the page that contains the JSP.

(3), the files should be stored in each directory: according to Tomcat's specification, Tomcat Web application should be composed of the following directory

n the location of files such as page content: *.html, *.jsp, etc. can have many directory levels, by the user's site structure, the implementation of the function should be the interface of the site, that is, the user's main visible part. In addition to HTML files, JSP files, there are JS (JavaScript) files and CSS (style sheet) files, as well as other multimedia files.

N Web-inf/web.xml This is a description file for a Web application. This file is an XML file that describes the servlet and other component information for this Web application, including some initialization information and security constraints, and so on.

n web-inf/classes/this directory and its subdirectories should include all compiled Java class file (*.class) files such as JavaBean and servlets for this WEB application. and other class files and related resources that were not compressed into the jar package. Note that the Java class in this directory should organize the directory according to the package hierarchy to which it belongs (that is, if the *.class file has a package definition, the *.class file should be placed under the. \web-inf\classes\ package name).

N usually web-inf/classes/the class file in this directory can also be packaged into a jar file, and can be placed in the Web-inf under the Lib directory. Package each *.class file in the classes directory as a Webmis.jar file (jar CVF Webmis.jar * *)

Attention:

(1) The Web-inf directory contains the resources used by the application, but Web-inf is not in the public document root directory . The files contained in this directory cannot be accessed by the client.

(2) The class directory (under Web-inf) contains classes such as the Servlets,beans that are required to run the Web application.

(3) The Lib directory (under Web-inf) contains *.jar files for Java archive Files (JARs), such as tag libraries or Servlets,beans classes.

(4) If a class appears in the jar file and also appears in the directory of the class, the ClassLoader loads the one that is located in the class directory.

n common/lib/This directory contains all the class files and related files that are compressed into the jar file. For example: Java library files provided by third parties, JDBC drivers, etc.

ü The JDBC driver where Msbase.jar, Mssqlserver.jar, msutil.jar files are SqlServer2000

ü The package where Servlet-api.jar and Jsp-api.jar are the APIs for Servlets and JSPs

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The "directory structure" of Tomcat profile

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.