Apache Tomcat, often called Tomcat Server, is an open-source Java Servlet container, which is developed by Apache Software Foundation. Tomcat implements a few JAVA EE specifications including Java servlet, JavaServer Pages (JSP), Java EL or WebSocket. It offers purely Java http web server, on which is possible to execute code written in Java.

Tomcat is developed and maintained by an open community of developers under the wings of Apache Software Foundation.

Components

Tomcat has following components: Catalina as servlet container, Coyote as http connector and Jasper as JSP engine.

Catalina

Catalina is Tomcat servlet container. Catalina implements servlet specifications from Sun Microsystems and JavaServer Pages (JSP). In Tomcat Realm, element represents database of user names, passwords and roles (similarly as groups in Unix) assigned to these users.

Different Realm implementations allow Catalina to be integrated to environment, where the authentication information is already created and preserved and then are this information used for implementation of Container Managed Security, as is stated in servlet specification.

Coyote

Coyote is component, which serves are connector. It supports http 1.1 protocol same as web server. It allows Catalina to perform also as ordinary web server (not only as servlet or JSP container), which hols local files in a form of http documents.

Coyote waits for the incoming connection to server on specific TCP port and passes on Tomcat engine’s requests, which them then processes and sends back the answer to the client. Another connector Coyote is Coyote JK. It waits similarly for the incoming connection, but requests are sent over to another web server, as e. g. Apache, with the use of JK protocol. It leads to higher efficiency.

Jasper

Jasper is JSP engine of Tomcat. Jasper parses JSP file to compile them into the Java code as servlets, which can then be processed with the help of Catalina. During executing, Jasper detects changes of JSP files and compiles them again.

Cluster

This component was added to manage large applications. It is used for load balancing, which can be achieved with the help of different techniques.

High availability

Function of high availability was added to Tomcat, so it would simplify the system of actualizations without the impact on production environment. This is achieved by the live traffic being temporarily redirected to other port, whereas the main server actualizes on the main port. That is particularly useful in a case of web applications with high traffic.

Web applications

Tomcat also contains extension for support of the user and system web apps, so it would be possible to deploy them through the different environments. It also arranges the sessions and applications management throughout network.

Advantages of using Tomcat

  • Minimalistic. Even though Tomcat has JavaEE certification, it is very minimalistic app. It offers only basic functions that are need for the server’s run, which means, it offers fast loading and deployment compared to the many competitive options. Minimalism also helps speeding up the development cycle.
  • Flexibility. Thanks to minimalism with wide options of customization is Tomcat relatively flexible. It is possible to execute it by almost random way.
  • Stability. Tomcat is very stable platform, on which is possible to build and use it for the app execution. Tomcat runs independently on the Apache installation, even when there happens to be major failure, the rest of the server still runs.
  • Security. Tomcat can be the added layer of security on server.
  • Simple configuration. Configuration is relatively simple to implement.
  • Documentation. There is a rich documentation available for Tomcat.

Disadvantages of using Tomcat

  • The richness of functionalities. If you look for server with a lot of functionalities, Tomcat is probably not the right choice.
  • Recompilation. Because it is built on Java, it is typically necessary to go through recompilation in case of actualizations. It can dramatically prolong the time of development.