π°οΈ Apache Tomcat Server and Other Java Servers Explained in Detail
πΉ What is Apache Tomcat?
Apache Tomcat is a free, open-source web server developed by the Apache Software Foundation. It is not a full Java EE (Jakarta EE) server, but it implements the Java Servlet, JSP, and WebSocket specifications.
β Key Features of Apache Tomcat
Feature
Description
Developed by
Apache Software Foundation
Type
Web server & servlet container (not a full application server)
Supports
Java Servlets, JSP (JavaServer Pages), WebSockets
Platform
Cross-platform (Linux, Windows, macOS)
Protocols
HTTP, HTTPS, AJP
Lightweight
Ideal for small-to-medium scale web applications
Easy Deployment
WAR file deployment
Embeddable
Can be embedded in Java apps (via Spring Boot)
Default Port
8080
βοΈ How Tomcat Works
Client sends HTTP request to Tomcat server.
Tomcat maps the request to a servlet or JSP.
Servlet processes the request and generates a response.
Tomcat returns the HTTP response back to the client.
π Directory Structure (Brief)
Folder
Purpose
bin/
Startup and shutdown scripts
conf/
Configuration files (server.xml)
webapps/
Location to deploy web apps (WAR folders)
logs/
Log files
lib/
Libraries required by Tomcat
work/
Temporary files compiled by JSP engine
π Common Alternative Java Servers
Server
Type
Description
Tomcat
Web Server + Servlet Engine
Supports servlets, JSP; lightweight and popular
Jetty
Web Server + Servlet Engine
Lightweight, embeddable, used in tools like Eclipse and Maven
GlassFish
Full Java EE Application Server
Official reference implementation of Java EE (Jakarta EE)
WildFly (ex-JBoss)
Full Java EE App Server
High performance, enterprise features, supports clustering
WebLogic
Full Java EE App Server
Developed by Oracle; powerful but commercial
WebSphere
Full Java EE App Server
Developed by IBM; enterprise-grade, robust but complex
Undertow
Lightweight Web Server
Used in WildFly; extremely fast and embeddable
Payara
Fork of GlassFish
More stable and commercial support available
π Comparison: Tomcat vs Full Application Servers
Feature
Tomcat
Full Java EE Servers (e.g., WildFly, GlassFish)
Servlet & JSP Support
β Yes
β Yes
EJB, JPA, JMS Support
β No (needs external lib)
β Yes
Lightweight
β Yes
β Heavier
Startup Time
Fast
Slower
Microservices Ready
β With Spring Boot
β With configurations
Enterprise Ready
β
β Yes
π‘ When to Use What?
Use Case
Recommended Server
Simple web app (Servlet/JSP)
Apache Tomcat
REST APIs with Spring Boot
Tomcat (embedded)
Full Java EE stack (EJB, JMS, JPA, etc.)
WildFly / GlassFish
Large enterprise applications
WebLogic / WebSphere
Embedded Java server inside application
Jetty / Undertow
π¦ Tomcat and Spring Boot
Spring Boot includes an embedded Tomcat server by default.
You donβt need to install Tomcat separately β just run the main() method.
Top comments (0)