ArticleslgStudy

computer science

Apache Tomcat

Apache Tomcat is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Apache Tomcat rather than just read about it. In short: Apache Tomcat (called "Tomcat" for short) is a free and open-source implementation of the Jakarta EE Servlet, Pages, Expression Language, WebSocket, Annotations and Authentication technologies. It provides a "pure Java" HTTP web server environment in which Java code can also run.

Apache Tomcat — main illustration
Apache Tomcat — illustration

Key takeaways

  • Apache Tomcat belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Apache Tomcat to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Apache Tomcat from memory before moving on to harder problems.

Reference excerpt

Apache Tomcat (called "Tomcat" for short) is a free and open-source implementation of the Jakarta EE Servlet, Pages, Expression Language, WebSocket, Annotations and Authentication technologies. It provides a "pure Java" HTTP web server environment in which Java code can also run. Thus it is a Java web application server, although not a full Jakarta EE application server. Tomcat is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation, released under the Apache License 2.0 license.

Components Tomcat 4.x was released with Catalina (a servlet container), Coyote (an HTTP connector) and Jasper (a JSP engine).

Catalina Catalina is Tomcat's servlet container. Catalina implements Sun Microsystems' specifications for servlet and JavaServer Pages (JSP). In Tomcat, a Realm element represents a "database" of usernames, passwords, and roles (similar to Unix groups) assigned to those users. Different implementations of Realm allow Catalina to be integrated into environments where such authentication information is already being created and maintained, and then use that information to implement Container Managed Security as described in the Servlet Specification.

Coyote Coyote is a Connector component for Tomcat that supports the HTTP 1.1 and 2 protocol as a web server. This allows Catalina, nominally a Java Servlet or JSP container, to also act as a plain web server that serves local files as HTTP documents. Coyote listens for incoming connections to the server on a specific TCP port and forwards the request to the Tomcat Engine to process the request and send back a response to the requesting client. Another Coyote Connector, Coyote JK, listens similarly but instead forwards its requests to another web server, such as Apache, using the JK Protocol. This usually offers better performance.

Jasper Jasper is Tomcat's JSP Engine. Jasper parses JSP files to compile them into Java code as servlets (that can be handled by Catalina). At runtime, Jasper detects changes to JSP files and recompiles them. As of version 5, Tomcat uses Jasper 2, which is an implementation of the Sun Microsystems' JSP 2.0 specification. From Jasper to Jasper 2, important features were added:

JSP Tag library pooling – Each tag markup in JSP file is handled by a tag handler class. Tag handler class objects can be pooled and reused in the whole JSP servlet. Background JSP compilation – While recompiling modified JSP Java code, the older version is still available for server requests. The older JSP servlet is deleted once the new JSP servlet has finished being recompiled. Recompile JSP when included page changes – pages can be inserted and included into a JSP at runtime. The JSP will not only be recompiled with JSP file changes but also with included page changes. JDT Java compiler – Jasper 2 can use the Eclipse JDT (Java Development Tools) Java compiler instead of Ant and javac. Three new components were added with the release of Tomcat 7:

Cluster This component has been added to manage large applications. It is used for load balancing that can be achieved through many techniques. Clustering support currently requires the JDK version 1.5 or higher.

High availability A high-availability feature has been added to facilitate the scheduling of system upgrades (e.g. new releases, change requests) without affecting the live environment. This is done by dispatching live traffic requests to a temporary server on a different port while the main server is upgraded on the main port. It is very useful in handling user requests on high-traffic web applications.

Features Tomcat 9.x implements the Servlet 4.0 and JSP 2.3 Specifications. Tomcat 10.1.x implements the Servlet 6.0 and JSP 3.1 Specifications. Tomcat 11.x implements the Servlet 6.1 and JSP 4.0 Specifications.

History Tomcat started off in November 1998 as a servlet reference implementation by James Duncan Davidson, a software architect at Sun Microsystems. He later helped make the project open-source and played a key role in its donation by Sun Microsystems to the Apache Software Foundation. The Apache Ant software build automation tool was developed as a side-effect of the creation of Tomcat as an open source project. Davidson had initially hoped that the project would become open-sourced and, since many open-source projects had O'Reilly books associated with them featuring an animal on the cover, he wanted to name the project after an animal. He came up with Tomcat since he reasoned the animal represented something that could fend for itself. Although the tomcat was already in use for another O'Reilly title, his wish to see an animal cover eventually came true when O'Reilly published their Tomcat book with a snow leopard on the cover in 2003.

Apache TomEE Apache TomEE (pronounced "Tommy") is the Enterprise Edition of Apache Tomcat (Tomcat + Java/Jakarta EE = TomEE) that combines several Java enterprise projects including Apache OpenEJB, Apache OpenWebBeans, Apache OpenJPA, Apache MyFaces and others. In October 2011, the project obtained certification by Oracle Corporation as a compatible implementation of the Java EE 6 Web Profile.

See also

WildFly, formerly known as JBoss Application Server Jetty (web server) GlassFish, the reference implementation of Jakarta EE (and Java EE before that), supporting EJB, JPA, JSF, JMS, Java RMI, JSP, servlets etc. Comparison of web server software Related software that is now obsolete or defunct:

MuleSoft, producer of Tcat, an enterprise Tomcat server Apache Geronimo, an application server that can use Tomcat as its web container Resin (software), an application server from Caucho Technology JOnAS, an application server that can use Tomcat as its web container Apache OpenEJB can be added to Tomcat to turn it into a JavaEE server

References

Bibliography

External links

Official website

Illustrations

Apache Tomcat illustration
Apache Tomcat illustration

Worked examples

Example 1 — a first encounter with Apache Tomcat

Start with the simplest possible case. Write down what Apache Tomcat claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Apache Tomcat before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Apache Tomcat ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Apache Tomcat

In research
Apache Tomcat appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Apache Tomcat in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Apache Tomcat is common in secondary-school and first-year university syllabi. It links to neighbouring topics Apache Software Foundation projects, Cross-platform free software, Free software programmed in Java, so understanding it makes those chapters shorter.
In everyday life
Look for Apache Tomcat outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Apache Tomcat” →

How to study Apache Tomcat in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Apache Tomcat means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Apache Tomcat out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Apache Tomcat in simple terms?

Apache Tomcat (called "Tomcat" for short) is a free and open-source implementation of the Jakarta EE Servlet, Pages, Expression Language, WebSocket, Annotations and Authentication technologies. It provides a "pure Java" HTTP web server environment in which Java code can also run.

Why does Apache Tomcat matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Apache Tomcat?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Apache Tomcat.

Tags

  • Apache Software Foundation projects
  • Cross-platform free software
  • Free software programmed in Java
  • Free web server software
  • Java enterprise platform
  • Software using the Apache license
  • Web server software programmed in Java

Keep exploring