What is Tomcat? The original Java servlet container - InfoWorld .

Java Coding

4 Views

        

Apache Tomcat is a long-lived, open source Java servlet container that implements core Java enterprise (now Jakarta EE) specifications, including the Jakarta Servlet, Jakarta Server Pages, and Jakarta WebSocket specs.

Tomcat was first released by the Apache Software Foundation in 1998, just four years after Java itself. Tomcat started as the reference implementation for the original Java Servlet API and JavaServer Pages specification. Today, it remains the most widely used Java application server, boasting a well-tested and proven core engine with good extensibility.

In this short introduction, you'll learn why many developers choose Tomcat for running Java web applications. You'll get an overview of Tomcat and how it's used, installation instructions, and a brief guide to the four ways to deploy a Java application using Tomcat.

Is Tomcat an app server or a web server?

The Java ecosystem supports several kinds of application server:

  • A servlet container is an implementation of the Jakarta Servlet specification, used primarily for hosting servlets.
  • A web server is a server designed to serve files from the local system, like Apache.
  • A Java enterprise application server is a full-blown implementation of the Jakarta EE specification.

At heart, Tomcat is a servlet and JSP container:

  • A Java (or Jakarta) servlet defines endpoints for HTTP requests and routes them to business logic code for handling.
  • JSP, or Jakarta Server Pages, is a server-side view-rendering technology that allows defining HTML interfaces using data from inside the server and information from the request and response. As the developer, you write the servlet or JSP page, define rules for the requests and responses, then let Tomcat handle the routing.

Tomcat also contains the Coyote web server. Coyote makes it possible to use Tomcat to serve static files in combination with Apache web server (more about that shortly).

Copyright © 2022 IDG Communications, Inc.