Lesson 2 | Jakarta Servlet Specification |
Objective | Understand the role of the Jakarta Servlet specification and how it evolved from the Java Servlet Development Kit (JSDK). |
The Jakarta Servlet specification defines the standard API for building server-side web components that respond to HTTP requests. Originally known as the Java Servlet Development Kit (JSDK) and developed by Sun Microsystems, this technology was a precursor to the modern Jakarta Servlet framework. The JSDK provided foundational classes for developing and testing servlets before they became part of the broader Java 2 Platform, Enterprise Edition (J2EE). Over time, the servlet API was integrated into J2EE, later rebranded as Java EE, and today lives on as part of Jakarta EE, governed by the Eclipse Foundation.
The early Java Servlet Development Kit served as a test environment for experimenting with servlets, including a minimal web server and example code. However, it was not intended for production use and has since been deprecated. Rather than being replaced by a single new kit, its functionality was standardized within the Jakarta Servlet specification — a core component of the Jakarta EE platform.
Jakarta EE provides a unified, open-source platform for enterprise-grade web applications, including technologies such as Jakarta Server Pages (JSP), Jakarta Faces, Jakarta Persistence, and Jakarta Security. The servlet specification continues to evolve under the Jakarta EE Working Group, ensuring compatibility with modern web standards and cloud-native deployment models.
To develop and deploy servlets today, developers typically use a Jakarta Servlet container such as Apache Tomcat, Eclipse Jetty, or Payara Server. These containers implement the servlet specification and provide a runtime environment for executing servlet-based web applications.
Tomcat remains one of the most popular open-source servlet containers and reference implementations. It supports the latest versions of the Jakarta Servlet API, making it ideal for both development and production. For example, Tomcat 10 implements Jakarta Servlet 5.0, where all servlet classes now use the jakarta.servlet
package instead of javax.servlet
.
To verify your Tomcat version on a Linux server, run the following command:
cd $CATALINA_HOME/lib
java -cp catalina.jar org.apache.catalina.util.ServerInfo
This will display information about the Tomcat version, build date, and the Jakarta Servlet API it supports. Ensure that your environment uses the latest version of Tomcat for compatibility with modern Jakarta EE standards.
Developers no longer need to download a standalone JSDK. The Jakarta Servlet API is automatically included when setting up a Jakarta EE–compliant runtime or when adding Tomcat as a servlet container. For Maven-based projects, developers can include the dependency directly in their pom.xml
:
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.0.0</version>
<scope>provided</scope>
</dependency>
For developers using Gradle, the equivalent dependency is:
implementation 'jakarta.servlet:jakarta.servlet-api:6.0.0'
These libraries enable your Java web applications to compile servlets and JSPs using the Jakarta EE namespace and modern features.
The Java Servlet Development Kit was an early experiment that laid the foundation for server-side Java programming. It has since been fully integrated and modernized through the Jakarta Servlet specification. Developers today should use Jakarta EE–compliant tools and containers like Apache Tomcat to ensure compatibility with the latest versions of the servlet API and to take advantage of community-driven innovation led by the Eclipse Foundation.