Javalin is a web framework for Java and Kotlin which is simple, lightweight, interoperable, and flexible.
With the major changes introduced in the codebase, the team has now announced the release of Javalin 2.0 RC3. Some of the updates include removal of some abstraction layers, using Set instead of List, removal of CookieBuilder, Javalin lambda replacing Javalin Jetty, and more.
The following table lists the packages whose structure have been updated in this release:
Javalin 1.7 | Javalin 2.0 RC3 |
io.javalin.embeddedserver.jetty.websocket | io.javalin.websocket |
io.javalin.embeddedserver.Location | io.javalin.staticfiles.Location |
io.javalin.translator.json.JavalinJsonPlugin | io.javalin.json.JavalinJson |
io.javalin.translator.json.JavalinJacksonPlugin | io.javalin.json.JavalinJackson |
io.javalin.translator.template.JavalinXyzPlugin | io.javalin.rendering.JavalinXyz |
io.javalin.security.Role.roles | io.javalin.security.SecurityUtil.roles |
io.javalin.ApiBuilder | io.javalin.apibuilder.ApiBuilder |
io.javalin.ApiBuilder.EndpointGrooup | io.javalin.apibuilder.EndpointGrooup |
app.embeddedServer(new EmbeddedJettyFactory(() -> new Server())) // v1
Now with the removal of embedded server abstraction, we can directly write this:
app.server(() -> new Server()) // v2
The following are enabled by default:
Since Jetty WebSockets have limited functionality, it is now replaced with the Javalin lambda WebSockets.
This is an interface used to set per-endpoint authentication and authorization. Use Set instead of List. It now runs for every single request, but the default-implementation does nothing.
Context is the object, which provides you with everything needed to handle an http-request.
The following updates are introduced in Context:
In this article we looked at some of the major updates in Javalin 2.0. To know more, head over to their GitHub repository.
Kotlin 1.3 M1 arrives with coroutines, and new experimental features like unsigned integer types
Top frameworks for building your Progressive Web Apps (PWA)
Kotlin/Native 0.8 recently released with safer concurrent programming