# javalin/javalin

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/javalin-javalin).**

8,290 stars · 642 forks · Kotlin · Apache-2.0

## Links

- GitHub: https://github.com/javalin/javalin
- Homepage: https://javalin.io
- awesome-repositories: https://awesome-repositories.com/repository/javalin-javalin.md

## Topics

`hacktoberfest` `java` `javalin` `jetty` `kotlin` `microservice` `rest-api` `servlet` `web-framework`

## Description

Javalin is a lightweight web framework for Java and Kotlin designed for building REST APIs and web applications. It functions as an embedded Jetty web server, allowing applications to run as standalone processes without the need for an external servlet container.

The project provides specialized frameworks for diverse communication patterns, including a REST API framework with automatic OpenAPI schema generation, a GraphQL API framework with query and mutation resolvers, and a WebSocket server for bidirectional real-time communication. It also includes a dedicated framework for pushing real-time updates via Server-Sent Events.

Beyond API capabilities, the system covers server-side UI rendering through pluggable template engines and a buildless integration for serving Vue components. It includes a comprehensive suite of middleware for request interception, role-based access control, TLS encryption, and request rate limiting.

The server is configured through a programmatic configuration block that defines routes, handlers, and lifecycle event callbacks before the application starts.

## Tags

### Web Development

- [Java](https://awesome-repositories.com/f/web-development/java.md) — A lightweight web framework for building REST APIs and web applications in Java and Kotlin.
- [Lightweight Web Frameworks](https://awesome-repositories.com/f/web-development/lightweight-web-frameworks.md) — Acts as a minimalist web framework for Java and Kotlin, enabling rapid development of web services.
- [Embedded Web Servers](https://awesome-repositories.com/f/web-development/embedded-web-servers.md) — Provides a lightweight HTTP server integrated directly into the application process as an embedded component.
- [GraphQL APIs](https://awesome-repositories.com/f/web-development/graphql-apis.md) — Provides a framework for exposing data models through a GraphQL API with support for queries, mutations, and subscriptions. ([source](https://javalin.io/plugins/graphql))
- [Field Resolvers](https://awesome-repositories.com/f/web-development/graphql-apis/field-resolvers.md) — Implements resolver functions that map GraphQL queries to specific data-fetching logic. ([source](https://javalin.io/plugins/graphql))
- [GraphQL Subscriptions](https://awesome-repositories.com/f/web-development/graphql-subscriptions.md) — Implements server-side GraphQL subscriptions to provide real-time data streams to clients. ([source](https://javalin.io/plugins/graphql))
- [HTTP Endpoint Mapping](https://awesome-repositories.com/f/web-development/http-endpoint-mapping.md) — Maps HTTP methods and paths to handler functions to serve data using parameters and wildcards. ([source](https://javalin.io/documentation))
- [Middleware Chains](https://awesome-repositories.com/f/web-development/middleware-chains.md) — Uses a middleware chain architecture to process HTTP requests through sequential before, endpoint, and after handlers.
- [Real-Time Communication](https://awesome-repositories.com/f/web-development/real-time-communication.md) — Supports bidirectional real-time communication via WebSockets and unidirectional streaming via Server-Sent Events.
- [Request Context](https://awesome-repositories.com/f/web-development/request-context.md) — Provides a centralized context object to read and write request and response data throughout the request lifecycle. ([source](https://javalin.io/documentation))
- [REST API Frameworks](https://awesome-repositories.com/f/web-development/rest-api-frameworks.md) — Provides a framework for building structured HTTP endpoints that process parameters and return serialized data.
- [RESTful API Development](https://awesome-repositories.com/f/web-development/restful-api-development.md) — Provides a comprehensive toolkit for REST API development, including path parameters, validation, and OpenAPI generation.
- [Jetty Server Launchers](https://awesome-repositories.com/f/web-development/web-infrastructure-deployment/web-infrastructure-servers/web-server-hosting/headless-server-hosting/game-server-hosting/embedded-server-hosting/jetty-server-launchers.md) — Provides programmatic control over the embedded Jetty server, including host, port, and thread pool settings. ([source](https://javalin.io/documentation))
- [Compile-Time Generators](https://awesome-repositories.com/f/web-development/api-schema-generation/compile-time-generators.md) — Provides compile-time API schema generation via annotation processing to eliminate runtime reflection overhead.
- [Parameter Coercion and Validation](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/query-parameter-validations/parameter-coercion-and-validation.md) — Validates and coerces query, form, path parameters, and headers against defined types and constraints. ([source](https://javalin.io/documentation))
- [Vue Server-Side Renderers](https://awesome-repositories.com/f/web-development/backend-development/web-frameworks/rendering-and-layout-architectures/server-side-rendering-frameworks/framework-integrations/next-js/server-side-renderings/vue-server-side-renderers.md) — Renders Vue component files directly on the server to generate HTML pages without a separate frontend build step.
- [Exception Response Mapping](https://awesome-repositories.com/f/web-development/backend-development/web-frameworks/routing-request-handling/error-route-handling/exception-response-mapping.md) — Implements mechanisms to map internal server exceptions to specific HTTP response status codes and bodies. ([source](https://javalin.io/documentation))
- [Error Handlers](https://awesome-repositories.com/f/web-development/error-handlers.md) — Provides centralized error handlers to intercept application errors and return standardized HTTP responses. ([source](https://javalin.io/migration-guide-javalin-6-to-7))
- [Content-Type Differentiated Error Responses](https://awesome-repositories.com/f/web-development/error-response-mappers/content-type-differentiated-error-responses.md) — Provides custom error responses that vary the body format based on the request's accepted content type. ([source](https://javalin.io/documentation))
- [Configuration-Block Lifecycle Handlers](https://awesome-repositories.com/f/web-development/lifecycle-events/configuration-block-lifecycle-handlers.md) — Allows the registration of lifecycle event handlers directly within the server's configuration block. ([source](https://javalin.io/migration-guide-javalin-6-to-7))
- [Multipart Upload Utilities](https://awesome-repositories.com/f/web-development/multipart-upload-utilities.md) — Receives and processes uploaded files from multipart/form-data requests as structured objects. ([source](https://javalin.io/archive/docs/v6.X.html))
- [Template-Driven Rendering](https://awesome-repositories.com/f/web-development/rendering-templating/server-side-rendering/template-driven-rendering.md) — Provides capabilities to generate dynamic HTML by merging data models with server-side templates. ([source](https://javalin.io/plugins/rendering))
- [Request Middleware](https://awesome-repositories.com/f/web-development/request-middleware.md) — Executes post-request middleware for cleanup and logging after every request, including exceptions. ([source](https://javalin.io/documentation))
- [RESTful CRUD Implementations](https://awesome-repositories.com/f/web-development/restful-crud-implementations.md) — Implements standardized interfaces for mapping HTTP methods to create, read, update, and delete operations. ([source](https://javalin.io/documentation))
- [Route Grouping](https://awesome-repositories.com/f/web-development/route-grouping.md) — Organizes API endpoints into nested path groups to share middleware and reduce path repetition. ([source](https://javalin.io/archive/docs/v5.6.X.html))
- [Routing Configurations](https://awesome-repositories.com/f/web-development/routing-configurations.md) — Provides a programmatic configuration block to define all routes before the server starts. ([source](https://javalin.io/migration-guide-javalin-6-to-7))
- [Server-Side Rendering](https://awesome-repositories.com/f/web-development/server-side-rendering.md) — Supports server-side UI rendering through pluggable template engines and buildless Vue component serving.
- [Vue Reactive State Injections](https://awesome-repositories.com/f/web-development/server-side-state-resumption/vue-reactive-state-injections.md) — Injects server-side data into Vue instances on every request as a reactive state variable. ([source](https://javalin.io/plugins/javalinvue))
- [Server-Side Rendering Engines](https://awesome-repositories.com/f/web-development/template-engines/server-side-rendering-engines.md) — Supports multiple pluggable server-side rendering engines for generating dynamic HTML responses. ([source](https://javalin.io/migration-guide-javalin-6-to-7))
- [Server-Side Component Serving](https://awesome-repositories.com/f/web-development/vue-component-wrappers/vue-component-libraries/server-side-component-serving.md) — Serves Vue components directly from the server into a single HTML page without requiring a build tool. ([source](https://javalin.io/plugins/javalinvue))
- [Vue Component Bindings](https://awesome-repositories.com/f/web-development/vue-development/route-mapping/vue-component-bindings.md) — Associates Vue components with server GET endpoints to apply server-side access control and middleware. ([source](https://javalin.io/plugins/javalinvue))
- [Web Framework Plugins](https://awesome-repositories.com/f/web-development/web-framework-plugins.md) — Enables the addition of custom functionality through reusable modules that hook into the request lifecycle. ([source](https://javalin.io/plugins/how-to))
- [REST Static File Servings](https://awesome-repositories.com/f/web-development/web-infrastructure-deployment/web-server-capabilities/static-asset-serving/rest-static-file-servings.md) — Serves static files from the classpath or file system alongside dynamic REST endpoints. ([source](https://javalin.io/documentation))

### Data & Databases

- [GraphQL Mutation Implementations](https://awesome-repositories.com/f/data-databases/graphql-integrations/mutation-handlers/graphql-mutation-implementations.md) — Implements server-side logic for handling GraphQL mutations to create, update, or delete data. ([source](https://javalin.io/plugins/graphql))

### Development Tools & Productivity

- [Declarative Server Configurations](https://awesome-repositories.com/f/development-tools-productivity/development-environment-setup/configuration-based-setup/declarative-server-configurations.md) — Defines all server routes, handlers, and settings within a centralized configuration block for explicit initialization.
- [Embedded Server Lifecycles](https://awesome-repositories.com/f/development-tools-productivity/terminal-shell-cli/cli-tooling-frameworks/cli-tooling/server-cli/web-server-launches/embedded-server-lifecycles.md) — Enables programmatic launching and termination of the embedded server with support for graceful shutdown. ([source](https://javalin.io/archive/docs/v6.X.html))
- [Embedded Server Management](https://awesome-repositories.com/f/development-tools-productivity/terminal-shell-cli/cli-tooling-frameworks/cli-tooling/server-cli/web-server-launches/embedded-server-management.md) — Provides comprehensive management of the embedded Jetty server, from SSL configuration to request throttling.
- [Resolver Context Injection](https://awesome-repositories.com/f/development-tools-productivity/strict-dependency-resolvers/resolver-context-injection.md) — Injects shared dependencies and metadata into GraphQL resolver functions using a context annotation. ([source](https://javalin.io/plugins/graphql))

### DevOps & Infrastructure

- [Global Server Settings](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/server-and-site-configuration/global-server-settings.md) — Provides centralized configuration for server parameters including thread pools, timeouts, and compression strategies. ([source](https://javalin.io/archive/docs/v6.X.html))
- [Handler Route Mapping](https://awesome-repositories.com/f/devops-infrastructure/rest-api-endpoint-management/handler-route-mapping.md) — Maps incoming HTTP requests to specific handler functions during the application configuration phase. ([source](https://javalin.io/migration-guide-javalin-6-to-7))

### Security & Cryptography

- [TLS Traffic Encryption](https://awesome-repositories.com/f/security-cryptography/tls-traffic-encryption.md) — Secures communication channels using SSL/TLS encryption with support for PEM and keystores. ([source](https://javalin.io/plugins/ssl-helpers))
- [Client Certificate Management](https://awesome-repositories.com/f/security-cryptography/client-certificate-management.md) — Implements mutual TLS by requiring and validating client certificates against a configured trust store. ([source](https://javalin.io/plugins/ssl-helpers))
- [Custom Session Storage Providers](https://awesome-repositories.com/f/security-cryptography/identity-access-management/session-management/custom-session-storage-providers.md) — Provides a server session API for configuring custom session storage, caching, and cookie attributes. ([source](https://javalin.io/migration-guide-javalin-6-to-7))
- [HTTPS Enforcements](https://awesome-repositories.com/f/security-cryptography/network-infrastructure-security/web-network-security/security-https/https-enforcements.md) — Automatically forwards insecure HTTP requests to the secure HTTPS connector. ([source](https://javalin.io/plugins/ssl-helpers))
- [Request Rate Limiting](https://awesome-repositories.com/f/security-cryptography/request-rate-limiting.md) — Throttles the number of requests a client can make within a time window to protect server resources. ([source](https://javalin.io/migration-guide-javalin-6-to-7))
- [Role-Based Access Control](https://awesome-repositories.com/f/security-cryptography/role-based-access-control.md) — Manages user permissions and restricts endpoint access based on assigned roles. ([source](https://javalin.io/documentation))
- [TLS/SSL Configurations](https://awesome-repositories.com/f/security-cryptography/security/cryptography-and-secrets/cryptographic-primitives-management/tls-ssl-configurations.md) — Provides programmatic configuration for SSL and HTTP/2 support within the embedded server. ([source](https://javalin.io/documentation))
- [TLS Certificate Management](https://awesome-repositories.com/f/security-cryptography/tls-certificate-management.md) — Supports loading TLS certificate and private key material from PEM files, PKCS#12, or JKS keystores. ([source](https://javalin.io/plugins/ssl-helpers))
- [WebSocket Security](https://awesome-repositories.com/f/security-cryptography/websocket-security.md) — Provides handlers to perform authentication and validation during the WebSocket upgrade process. ([source](https://javalin.io/documentation))

### Software Engineering & Architecture

- [Embedded Runtime Models](https://awesome-repositories.com/f/software-engineering-architecture/embedded-runtime-models.md) — Utilizes an embedded Jetty runtime model to function as a standalone application without an external servlet container.
- [Asynchronous Request Handlers](https://awesome-repositories.com/f/software-engineering-architecture/concurrent-execution-managers/asynchronous-concurrency-managers/asynchronous-request-handlers.md) — Processes multiple client requests concurrently using asynchronous patterns to maintain high throughput. ([source](https://javalin.io/documentation))
- [Lifecycle Callbacks](https://awesome-repositories.com/f/software-engineering-architecture/event-driven-callbacks/lifecycle-callbacks.md) — Offers user-defined callbacks that trigger during specific server lifecycle stages such as startup and shutdown. ([source](https://javalin.io/documentation))
- [Wrapper Handlers](https://awesome-repositories.com/f/software-engineering-architecture/handler-middlewares/wrapper-handlers.md) — Provides wrapper handlers to execute custom logic around endpoints for propagating thread-local context. ([source](https://javalin.io/documentation))
- [Explicit Nullable Validators](https://awesome-repositories.com/f/software-engineering-architecture/runtime-value-validation/nullable-type-support/explicit-nullable-validators.md) — Provides validators that return nullable types by default and require explicit markers for required values. ([source](https://javalin.io/migration-guide-javalin-6-to-7))
- [Context Object Passing](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/layering-presentation/state-management-patterns/context-object-passing.md) — Implements a context object pattern to encapsulate request and response data for access throughout the handler chain.
- [Hook-Based Plugin Systems](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/plugin-module-systems/modular-plugin-architectures/plugin-based-architectures/hook-based-plugin-systems.md) — Features a hook-based plugin system that allows extending server functionality at specific configuration and startup milestones.

### Part of an Awesome List

- [File Upload](https://awesome-repositories.com/f/awesome-lists/devtools/file-upload.md) — Provides utilities to extract uploaded files from multipart requests via the request context. ([source](https://javalin.io/documentation))
- [GraphQL Frameworks](https://awesome-repositories.com/f/awesome-lists/devtools/graphql-frameworks.md) — Implements a full framework for exposing GraphQL schemas with query, mutation, and subscription resolvers.

### Networking & Communication

- [Websocket Connection Managers](https://awesome-repositories.com/f/networking-communication/connection-management/websocket-connection-managers.md) — Manages bidirectional communication with event handlers for WebSocket connection and session lifecycles. ([source](https://javalin.io/documentation))
- [WebSocket Event Systems](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-computing/communication-protocols/websocket-implementations/websocket-event-systems.md) — Provides a WebSocket event system for managing bidirectional communication through declarative connection and message handlers.
- [Status Code Response Bodies](https://awesome-repositories.com/f/networking-communication/http-clients/http-status-codes/exception-to-status-code-mappings/status-code-response-bodies.md) — Allows returning custom response bodies for specific HTTP status codes, tailored by content type. ([source](https://javalin.io/archive/docs/v6.X.html))
- [Server-Sent Events](https://awesome-repositories.com/f/networking-communication/server-sent-events.md) — Pushes real-time updates to connected clients over HTTP using the Server-Sent Events protocol. ([source](https://javalin.io/documentation))
- [WebSocket Servers](https://awesome-repositories.com/f/networking-communication/websocket-servers.md) — Implements persistent bidirectional communication channels for real-time data exchange.

### Programming Languages & Runtimes

- [OpenAPI Schema Generators](https://awesome-repositories.com/f/programming-languages-runtimes/java-annotation-processors/openapi-schema-generators.md) — Generates OpenAPI specification documents during compilation using Java annotation processors. ([source](https://javalin.io/plugins/openapi))
- [Virtual Thread Executors](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/concurrency/execution-models/multi-threaded-execution/virtual-thread-executors.md) — Offloads request handling to lightweight virtual threads to improve scalability on supported runtimes. ([source](https://javalin.io/documentation))
- [Lifecycle Hook Executions](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/runtime-environments/runtime-management-utilities/run-lifecycle-controls/lifecycle-hook-executions.md) — Executes custom logic at specific server milestones, such as when the server has successfully started. ([source](https://javalin.io/migration-guide-javalin-6-to-7))
