Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsJul 19, 2026·3 min de lectura

Jetty — Lightweight Embeddable Java Web Server

Eclipse Jetty is a high-performance HTTP server and servlet container that can be embedded into Java applications or run standalone, supporting HTTP/2, HTTP/3, and WebSocket.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
Jetty Overview
Comando de instalación directa
npx -y tokrepo@latest install eefd92c2-83b1-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

Introduction

Eclipse Jetty is a Java-based web server and servlet container used in production by thousands of organizations. Its embeddable design means you can start a full HTTP server from a main() method with a few lines of code, avoiding the overhead of deploying WAR files to an external container. Jetty also runs as a standalone distribution for traditional deployments.

What Jetty Does

  • Serves HTTP/1.1, HTTP/2, and HTTP/3 (QUIC) traffic with a unified handler API
  • Implements the Jakarta Servlet, WebSocket, and JSP specifications
  • Embeds directly into Java applications as a library dependency
  • Provides an asynchronous I/O layer built on Java NIO for high concurrency
  • Supports TLS, ALPN, and proxy protocols out of the box

Architecture Overview

Jetty is built around a Connector-Handler pipeline. Connectors accept network connections and negotiate protocols; Handlers process requests. Handlers can be composed into trees — a ContextHandlerCollection routes by path, a ServletHandler dispatches to servlets, and a GzipHandler compresses responses. The underlying transport layer uses an event-driven I/O model with configurable thread pools. This architecture allows Jetty to handle tens of thousands of concurrent connections on modest hardware.

Self-Hosting & Configuration

  • Embed via Maven/Gradle: add jetty-server and jetty-servlet dependencies
  • Create a Server instance, attach handlers or servlets, and call server.start()
  • For standalone use, download the Jetty distribution and deploy WAR files into $JETTY_BASE/webapps
  • Configure connectors, thread pools, and TLS in jetty.xml or programmatically
  • Enable HTTP/2 by adding the jetty-http2 module and configuring ALPN

Key Features

  • Embeddable design — no external container needed, perfect for microservices
  • Full HTTP/2 and experimental HTTP/3 support with automatic protocol negotiation
  • Low memory footprint compared to full application servers
  • Proven at scale — used by Google App Engine, Eclipse IDE, and Jenkins
  • Active maintenance under the Eclipse Foundation with frequent releases

Comparison with Similar Tools

  • Tomcat — Similar servlet container; Jetty is lighter and more embed-friendly while Tomcat is more widely used standalone
  • Undertow — Red Hat's embeddable server; Jetty has broader protocol support including HTTP/3
  • Netty — Low-level network framework; Jetty provides servlet-level abstractions on top
  • Spring Boot embedded — Uses Tomcat, Jetty, or Undertow under the hood; Jetty is one of the pluggable options
  • Nginx/Caddy — Native reverse proxies; Jetty is a Java application server, not a general-purpose proxy

FAQ

Q: Can I use Jetty as a reverse proxy? A: Yes. Jetty includes a ProxyServlet and an AsyncProxyServlet for forwarding requests to upstream services.

Q: How does Jetty compare to Tomcat for Spring Boot? A: Both work as embedded containers in Spring Boot. Jetty tends to use less memory and starts faster; Tomcat has broader community adoption.

Q: Does Jetty support Jakarta EE? A: Jetty 12 supports both javax and jakarta namespaces through its environment abstraction, making migration seamless.

Q: What Java version does Jetty require? A: Jetty 12 requires Java 17 or later. Jetty 11 supports Java 11+.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados