Skip to main content

Jakarta Servlet

Jakarta Servlet is a Jakarta EE specification that defines a server-side Java Application Programming Interface (API) (web application framework) for handling Hypertext Transfer Protocol (HTTP) requests and generating web responses within a servlet container.

  • API for request/response handling in web applications (web application framework)
  • Programming model for HTTP-based interaction, including request dispatching and filtering (web application framework)
  • Lifecycle management for servlets within a compatible container (application runtime)
  • Integration point for Jakarta EE web technologies such as JSP and expression handling (enterprise application platform)
  • Contract between servlet containers and web components for deployment and execution (application server infrastructure)

More About Jakarta Servlet

Jakarta Servlet is a core Jakarta EE specification that defines a Java-based programming model and runtime contract (web application framework) for server-side components that process requests and construct responses, most commonly over HTTP. It introduces the servlet as a managed component that runs inside a servlet container, which is typically part of a Jakarta EE compatible application server or a standalone web container.

The specification describes how a servlet container (application server infrastructure) manages the lifecycle of servlets, including loading, initialization, request handling, and destruction. It defines the interfaces for servlets, filters, and listeners, along with the request and response objects that encapsulate HTTP protocol details. This model allows application developers to focus on business logic while the container handles low-level protocol concerns, connection management, and threading.

Jakarta Servlet provides mechanisms for mapping URLs to servlets, dispatching requests, and applying filters (web application framework) to modify or inspect inbound and outbound traffic. Filters can implement concerns such as authentication, logging, or content transformation in a modular way. The specification also defines session management capabilities (session management) that allow applications to maintain conversational state across multiple HTTP requests using session identifiers and container-managed storage.

In enterprise environments, Jakarta Servlet functions as the foundational web tier API for Jakarta EE applications (enterprise application platform). Web applications are packaged and deployed into containers that implement the servlet specification, using deployment descriptors or annotations to configure servlet mappings, security constraints, and resource references. The servlet layer often integrates with other Jakarta EE technologies such as Jakarta Server Pages (JSP) and expression languages for view rendering, and with components such as enterprise beans or persistence APIs for backend processing.

Architecturally, Jakarta Servlet positions itself as the standard contract between web components and the hosting container (application server infrastructure), supporting a request-driven model where each incoming HTTP request is routed to a corresponding servlet or filter chain. The specification defines how containers must behave, which enables portability of web applications across compatible Jakarta EE runtime implementations. This portability is relevant for organizations that deploy the same application across different application servers or cloud environments that support Jakarta EE.

From a categorization standpoint, Jakarta Servlet can be placed in the web application framework and application server infrastructure categories. It provides an API and lifecycle model for HTTP request processing, extensible filtering, and session handling, and it operates as the base layer upon which higher-level Jakarta EE web technologies and frameworks build.