Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Apache Tomcat 7 Essentials

You're reading from   Apache Tomcat 7 Essentials This book takes you from beginner to expert in logical stages, covering all the essentials of Tomcat 7 from trouble-free installation to building your own middleware servers. Packed with examples and illustrations.

Arrow left icon
Product type Paperback
Published in Mar 2012
Publisher Packt
ISBN-13 9781849516624
Length 294 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Tanuj Khare Tanuj Khare
Author Profile Icon Tanuj Khare
Tanuj Khare
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Apache Tomcat 7 Essentials
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
1. Preface
1. Installation of Tomcat 7 FREE CHAPTER 2. Configuration and Deployment 3. Performance Tuning 4. Integration of Tomcat with the Apache Web Server 5. Securing Tomcat 7 6. Logging in Tomcat 7 7. Troubleshooting in Tomcat 8. Monitoring and Management of Tomcat 7 9. Clustering in Tomcat 7 10. Tomcat Upgrade 11. Advanced Configuration for Apache Tomcat 7

History of Tomcat


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.

Note

For more information on version changes, release, and comparison, visit http://en.wikipedia.org/wiki/Apache_Tomcat and http://wiki.apache.org/tomcat/FrontPage.

Tomcat support matrix

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.

Features and enhancements of Apache Tomcat 7

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.

Web application memory leak detection and prevention

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.

Servlet 3.0

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:

  • Asynchronous Support: Servlet 3.0's asynchronous support has been fully integrated into Tomcat 7. The biggest advantage of asynchronous programming is that the server doesn't have to wait for the response from the resources. For example, if you have 2000 concurrent users using an application, then we cannot allocate 2000 connections to the database and make the connection idle untill we get the response. By using asynchronous programming, your application can handle other user requests while this particular user is waiting for the response from the resources, such as DB, NAS, and so on.

  • Dynamic Configuration: It is again, a very vital feature of Servlet 3.0. Due to Tomcat 7's support for web fragments, developers now don't need to implement the specific library configurations for their application web.xml. This means, you can integrate the library reference in web.xml.

  • Annotation-based Configuration: With the additional support for Servlet 3.0 in Tomcat 7, developers can include decorative programming styles. The biggest advantage of implementing decorator is you can configure rewrite rules in the application servlet classes instead of web servers. Hence, you reduce the dependency on web servers. It also eliminates the need for deployment descriptors.

Improved logging

Tomcat 7 includes two new features for logging, in order to provide a good understanding to the users for log analysis:

  • Asynchronous file handler: The asynchronous handler allows Tomcat to write logs to the disk by a dedicated thread, so that logging operations do not cause any delay in processing threads.

  • Single line log formatter: The single line formatter writes logs in a single line, which is a better feature for administrators.

Aliases

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).

Note

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.

You have been reading a chapter from
Apache Tomcat 7 Essentials
Published in: Mar 2012
Publisher: Packt
ISBN-13: 9781849516624
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image