Apache Tomcat is an open source Java-based web and servlet container, which is used to host Java-based applications. It was first developed for Jakarta Tomcat. Due to an increase in demand, it was later hosted as a separate project called Apache Tomcat, which is supported by The Apache Software Foundation. It was initially developed by James Duncan Davidson, a software architect at Sun Microsystems. He later helped make this project open source and played a key role in donating this project from Sun Microsystems to The Apache Software Foundation. Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, and provides a "pure Java" HTTP web server environment for Java code to run.
Apache Tomcat version 7.0 implements the Servlet 3.0 and Java Server Pages 2.2 specifications from the Java Community Process. It includes many additional features that makes it a useful platform for developing and deploying web applications and web services.
In this chapter, we will discuss the following topics:
Tomcat was first introduced to the open source group in 1999 and its first version was released with 3.0.x version. Since then, it has been greatly supported by the open source community and widely accepted in the IT industry. In the current scenario, Tomcat is running in production environments, as well as being used for mission-critical projects in various industries. The following mentioned details give us a quick history of the versions.
Over the 12 years of of its successful journey, Tomcat has reached various states and given the IT industry various releases. Tomcat road maps outlined with their stable releases are mentioned as follows:
Version |
Release Date |
Description |
---|---|---|
3.0.x. (initial release) |
1999 |
Merger of donated Sun Java Web Server code and ASF, and implements Servlet 2.2 and JSP 1.1 specifications. |
3.3.2 |
March 9, 2004 |
Latest 3.x release. |
4.1.40 |
June 25, 2009 |
Latest 4.x release. |
5.5.32 |
February 1, 2011 |
Latest 5.x release. |
6.0.32 |
February 3, 2011 |
Latest 6.x release. |
7.0.0 beta |
June 29, 2010 |
First Apache Tomcat release to support Servlet 3.0, JSP 2.2, and EL 2.2 specifications. |
7.0.11 |
March 11, 2011 |
Fourth stable version. |
7.0.12 |
April 6, 2011 |
Current stable version. |
For more information on version changes, release, and comparison, visit http://en.wikipedia.org/wiki/Apache_Tomcat and http://wiki.apache.org/tomcat/FrontPage.
Apache Tomcat can be classified based on different components, such as the JDK version, enhancement, stability, and so on. Let's take a real time example, where you want to take a decision on which Apache Tomcat version to deploy for an application. For example, if an application is using Servlet 2.4 and JSP 2.0, then we should always go for the 5.x version. In reality, it's a difficult job to find out which version of Tomcat we should use to utilize the system resource properly.
Normally, these tasks would be done by the company's technical architect, and they are solely responsible for the technical specifications used in any product. Based on the features of Tomcat, let us quickly go through the comparison of Tomcat with different versions:
Features |
7.x |
6.x |
5.x |
4.x |
3.x |
---|---|---|---|---|---|
Version specifications |
Servlet 3.0, JSP 2.2, EL 2.2 |
Servlet 2.5, JSP 2.1 |
Servlet 2.4, JSP 2.0 |
Servlet 2.3, JSP 1.2 |
Servlet 2.2, JSP 1.1 |
Stable: |
Yes |
Yes |
Yes |
Yes |
Yes |
Enhancements |
Yes |
Yes |
Unlikely |
Highly unlikely |
Highly unlikely |
Bug Fixes |
Yes |
Yes |
Yes |
Highly unlikely |
Highly unlikely |
Security Fixes |
Yes |
Yes |
Yes |
Highly unlikely |
Highly unlikely |
Releases |
Yes |
Yes |
Yes |
Highly unlikely |
Highly unlikely |
Release Manager |
Mark Thomas (markt) |
Jean-Frederic Clere (jfclere) |
Filip Hanik (fhanik) |
Mark Thomas (markt) |
Bill Barker (billbarker) |
Process |
CTR |
RTC |
RTC |
CTR |
CTR |
Listed on download pages |
Yes |
Yes |
Yes |
No |
No |
JDK version |
1.6 |
1.5 |
1.4 |
1.3 |
1.1 |
In the previous table, highly unlikely means that the user using the previous version necessarily needs to have the upgraded higher version to support the new improved features. It also involves security fixes for the current version.
In the previous section, we discussed the various support matrices for Tomcat versions, we are now aware of the support specifications (JDK support, EJB, and Servlet) for Tomcat. Let's try to understand, and quickly review the new features/enhancements for Tomcat 7.
Apache Tomcat 7.x was released with some key improvements over Tomcat 6.x and real time implementation of Servlet 3.0, JSP 2.2, and EL 2.2 specifications. Apart from these, it also solves some major issues from previous releases.
Tomcat had a chronological problem of memory leaks in 4.x/5.x versions. While reloading the applications in the entire life cycle of Tomcat, OutOfMemoryError exceptions were generated. Tomcat has put an exceptional effort in tracking down the bugs and issues related to memory, in order to avoid memory leaks.
Tomcat 7 offers great support for Servlet 3.0. Servlet 3.0 helps developers to code very easily and also provides significant support for asynchronous programming techniques. The types of support provided are:
web.xml
. This means, you can integrate the library reference in web.xml
.Tomcat 7 includes two new features for logging, in order to provide a good understanding to the users for log analysis:
This is the best feature for an administrator. It provides the administrator with the freedom to eliminate the dependency of another web server to host multiple websites. In addition to this, you can host the entire static content (image/JavaScript in a single package).
Important points to remember about Tomcat 7 features
Apache Tomcat 7 can be run through JRE 1.6 or later. It means that we don't have to install the complete Java Development Kit (JDK). This will be really helpful in space crunch issues and the slimming of Java will utilize less memory. But, it is also recommended from the administrator's point of view, to install the complete Java Development Kit as it provides other utilities (jmap, jstack) which are very helpful to administrators. This has an inbuilt eclipse JIT (Just in Time) compiler.
Apache Tomcat 7 resolves class loading conflict issues, such as ClassCastExceptions. ClassCastExceptions mean that there is an issue with class while loading in runtime.
3.16.130.201