您的位置:寻梦网首页编程乐园Java天地JSP 专辑JSP001 HTML 离线版
Java 天地
JSP001 HTML 离线版
精选文章 >> Tomcat >> The Tomcat Servlet Engine from the Jakarta Project --from sun

由 webmaster 发布于: 2001-02-08 12:57

Red face

Developed by members of the Jakarta Project, Tomcat is a Java Servlet 2.2 servlet container and JavaServer Pages[tm] 1.1 implementation. There are other products like it, but Tomcat is the official reference implementation for these two technologies, and one of the few available that offers support for JSP 1.1.

Many people confuse Tomcat with Apache JServ. Tomcat is a Servlet API 2.2 and JSP 1.1 compliant container, while JServ is a Servlet API 2.0 compliant container that provides no support for JavaServer Pages. Early versions of Tomcat used some of the code written for JServ, especially the JServ Apache server adapter, but that's where the similarities ended. Tomcat now uses its own Apache server adapter, which will not work with JServ.

Deploying Tomcat
Tomcat 3.1, the latest quality release build, can be deployed as either a standalone product with its own internal Web server or in conjunction with several other Web servers including:


Apache, version 1.3 or later
Netscape Enterprise Server, version 3.0 or later
Microsoft Internet Information Server (IIS), version 4.0 or later
Microsoft Personal Web Server, version 4.0 or later

Tomcat requires a Java Runtime Environment conformant to JRE 1.1 or later, including any Java 2 Platform Enterprise Edition (J2EE[tm]) system. The Tomcat 3.1 build is easy to install and set up, as one of the new features included in this release is the automatic generation of Apache configuration files.

Deployment as Standalone Container
Even though you can deploy Tomcat as a standalone container, you need to address certain issues before making such a decision. Specifically, Tomcat has limitations in these areas:


Not as fast as Apache when it comes to static pages
Not as configurable as Apache
Not as robust as Apache

With this in mind, the developers of Tomcat suggest that Tomcat be deployed as a servlet container in conjunction with a Web server, such as Apache, rather than as a standalone product.

Migration from Apache JServ to Tomcat
If you are migrating from Apache JServ to Tomcat, be careful. The mod_jserv used with JServ will not work with Tomcat. The name of the module is the same, so you need to be certain that the correct mod_jserv has been installed.

Key Features
Tomcat has several features that differentiate it from the competition, including:


Support for JSP 1.1: Tomcat's most important feature. Very few commercial-quality JSP implementations currently support the 1.1 specification.
Servlet API 2.2 compliant: Because of this, Tomcat offers response output buffering and enhanced control over HTTP headers, as well as additional security and internationalization features.

Other features in Tomcat 3.1 also make it worth consideration:


Automatic servlet reloading: Servlets can be configured to be reloaded when code changes. However, this is only useful in development and causes serious performance issues in a production environment.
Thread pooling and JVM load balancing: Servlet containers that are using a thread pool free themselves from directly managing their threads. Instead of allocating a new thread, whenever they need one, they ask for it from the pool, and when they are done, the thread is returned to the pool. The thread pool can now be used to implement sophisticated thread management techniques.
Automatic deployment of Web ARchive (WAR) files: Servers that conform to the Java Servlet 2.2 specification are required to accept a Web Application Archive in a standard format. Applications placed in the Webapps directory, the WAR files are automatically expanded and executed based on the information contained in the WAR file.
NSAPI and ISAPI integration: Integration with Netscape Enterprise Server 3.0+ and Microsoft IIS 4.0+ provides more flexibility in architecture and integration with existing Web infrastructure.
A command line JSP to servlet code tool: Performance is slightly slower for JSP files than for servlets. By writing your JSPs and then converting them to servlets, you can achieve a performance boost. Tomcat provides a tool for this process.

Getting Started
The Jakarta Project Web site (http://jakarta.apache.org) provides information on downloading the latest release of Tomcat. Also available on the site is the FAQ-O-MATIC, which offers tips as well as solutions to problems you may run into during installation and setup.

Additional information is available at http://java.sun.com/products/jsp/tomcat/.



资料来源: JSP001.com