A simple, lightweight web framework for Java and Kotlin, on top of Jetty
open sourceApache-2.0free
Javalin is a lightweight web framework for Java and Kotlin: a few thousand lines of code on top of the Jetty web server, with performance close to raw Jetty. It has few concepts to learn: you declare routes with handlers, never extend classes and rarely implement interfaces, and apps are written the same way in both languages. Handlers are blocking by default and switch to asynchronous when you return a future; it supports virtual threads, WebSockets, static files and WebJars, and its OpenAPI plugin adds Swagger UI and ReDoc. Jetty can be configured fully, including SSL and HTTP/3.
Problems it solves
- a lightweight web framework for a small REST API in Java or Kotlin
- build an HTTP API on the JVM without Spring's annotations and boilerplate
- serve a JSON API and WebSockets from a simple Kotlin app
Features
- Routing with plain handlers
- Same API from Java and Kotlin
- Blocking by default, asynchronous with futures
- Virtual threads
- WebSockets
- Static files and WebJars
- OpenAPI plugin with Swagger UI and ReDoc
- Fully configurable Jetty, including SSL and HTTP/3
Alternatives
The same job
These do what Javalin does.
- Ktor Build asynchronous servers and clients in Kotlin
- Dropwizard Java framework for ops-friendly, high-performance RESTful web services
- Play Framework The high velocity web framework for Java and Scala
- Spring Boot Create stand-alone, production-grade Spring based applications that you can "just run"
