Tomcat 5.5 Notes

以下英文摘自官方jakarta文档

Tomcat 5.x 概述

Throughout the docs, you'll notice there are numerous references to $CATALINA_HOME. This represents the root of your Tomcat installation. When we say, "This information can be found in your $CATALINA_HOME/README.txt file" we mean to look at the README.txt file at the root of your Tomcat install.

$CATALINA_HOME的引用即对Tomcat安装根目录的引用

These are some of the key tomcat directories, all relative to $CATALINA_HOME:

  • /bin - Startup, shutdown, and other scripts. The *.sh files (for Unix systems) are functional duplicates of the *.bat files (for Windows systems). Since the Win32 command-line lacks certain functionality, there are some additional files in here.//主程序目录
  • /conf - Configuration files and related DTDs. The most important file in here is server.xml. It is the main configuration file for the container.//配置文件目录
  • /logs - Log files are here by default. //log记录
  • /webapps - This is where your webapps go. //项目目录

__________________________________________________________

As Tomcat 5 is a new release of Tomcat, keep in mind that some of the issues and solutions vary between the major versions of Tomcat (4.x versus 5). As you search around the web, there will be some documentation that is not relevant to Tomcat 5, but 3.x and 4.x. Doing 3.x or 4.x things to 5 will probably not work in most cases as the server.xml files are very different.

Tomcat 5.x 是新的版本,与旧的主要版本(4.x,3.x)有不同的特性,因此,互联网上的管与旧版本的资料极有可能不能适用于Tomcat 5.x版本。

以下为可以获得帮助的地方(不要想着中文文档了):

  • Current document - most documents will list potential hangups. Be sure to fully read the relevant documentation as it will save you much time and effort. There's nothing like scouring the web only to find out that the answer was right in front of you all along!
  • Tomcat FAQ as maintained by the developers.
  • Tomcat WIKI
  • Tomcat FAQ at jGuru
  • Tomcat mailing list archives - numerous sites archive the Tomcat mailing lists. Since the links change over time, clicking here will search Google.
  • The TOMCAT-USER mailing list, which you can subscribe to here. If you don't get a reply, then there's a good chance that your question was probably answered in the list archives or one of the FAQs. Although questions about web application development in general are sometimes asked and answered, please focus your questions on Tomcat-specific issues.
  • The TOMCAT-DEV mailing list, which you can subscribe to here. This list is reserved for discussions about the development of Tomcat itself. Questions about Tomcat configuration, and the problems you run into while developing and running applications, will normally be more appropriate on the TOMCAT-USER list instead.

_______________________________________________________

Tomcat 5.x 安装

 

在windows中,不推荐把Tomcat安装成为自动的服务!这样也许会很方便地每次开机加载,但是,这也会使得某些3rd Party IDE无法自由的开启、关闭或重启Tomcat服务。如果你已经这样做了,可以在管理工具->服务中,把Apache Tomcat服务置为“手动”。

安装前要设好JAVA_HOME环境变量。

If using a J2SE 1.4 JRE, the compatibility package must be downloaded and expanded inside the folder where Tomcat was installed.

Tomcat 5.5 was designed to run on J2SE 5.0, but it can run on JDK 1.4 as well, using the compatability package as detailed in the Tomcat installation instructions.

//Tomcat5被设计为运行在JRE1.5平台上。JRE 1.4可能无法使Tomcat 5.x正确的运行,需要下载补丁;推荐使用JDK1.5以上。

Standard Directory Layout

To facilitate creation of a Web Application Archive file in the required format, it is convenient to arrange the "executable" files of your web application (that is, the files that Tomcat actually uses when executing your app) in the same organization as required by the WAR format itself. To do this, you will end up with the following contents in your application's "document root" directory:

  • *.html, *.jsp, etc. - The HTML and JSP pages, along with other files that must be visible to the client browser (such as JavaScript, stylesheet files, and images) for your application. In larger applications you may choose to divide these files into a subdirectory hierarchy, but for smaller apps, it is generally much simpler to maintain only a single directory for these files.

  • /WEB-INF/web.xml - The Web Application Deployment Descriptor for your application. This is an XML file describing the servlets and other components that make up your application, along with any initialization parameters and container-managed security constraints that you want the server to enforce for you. This file is discussed in more detail in the following subsection. //应用程序部署的描述,以web.xml形式存储

  • /WEB-INF/classes/ - This directory contains any Java class files (and associated resources) required for your application, including both servlet and non-servlet classes, that are not combined into JAR files. If your classes are organized into Java packages, you must reflect this in the directory hierarchy under /WEB-INF/classes/. For example, a Java class named com.mycompany.mypackage.MyServlet would need to be stored in a file named /WEB-INF/classes/com/mycompany/mypackage/MyServlet.class
    //容纳所有程序所需的class文件,不能有jar形式的包存在,所有的package层次必须以文件夹层次的形式表现出来。例子如上。
  • /WEB-INF/lib/ - This directory contains JAR files that contain Java class files (and associated resources) required for your application, such as third party class libraries or JDBC drivers. //这个文件夹存放应用程序所需的所有jar文件,诸如各种第三方class以及JDBC驱动。

 

  • $CATALINA_HOME/common/lib - JAR files placed here are visible both to web applications and internal Tomcat code. This is a good place to put JDBC drivers that are required for both your application and internal Tomcat use (such as for a JDBCRealm). //这里的JAR文件对所有的应用程序和Tomcat内部编码可见,是个放置JDBC驱动的好位置

  • $CATALINA_HOME/shared/lib - JAR files placed here are visible to all web applications, but not to internal Tomcat code. This is the right place for shared libraries that are specific to your application.//这里的JAR文件对所有的应用程序可见,但对Tomcat内部编码不可见

Tomcat 5.x 应用程序部署的若干方法:

1. Copy unpacked directory hierarchy into a subdirectory in directory $CATALINA_HOME/webapps/.

2. Copy the web application archive file into directory $CATALINA_HOME/webapps/.

3. Use the Tomcat 5 "Manager" web application to deploy and undeploy web applications.

4. Use "Manager" Ant Tasks In Your Build Script.

5. Use the Tomcat Deployer.

 

Tomcat Classloader 的优先级:

When Tomcat 5 is started, it creates a set of class loaders that are organized into the following parent-child relationships, where the parent class loader is above the child class loader:

      Bootstrap
          |
       System
          |
       Common
      /      /
 Catalina   Shared
             /   /
        Webapp1  Webapp2 ... 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值