Javalin 2.0 Released
Written by Kay Ewbank   
Tuesday, 04 September 2018

A very lightweight web framework for Kotlin and Java has been updated to version 2.0. Javalin supports WebSockets, HTTP2 and async requests.

The developers say that Javalin’s main goals are simplicity, a great developer experience, and first class interoperability between Kotlin and Java. It is described as more library than framework:

"you don’t need to extend anything, there are no @Annotations, no reflection, no other magic; just code."

Javalin was inspired by Sparkjava and koa.js. It is written in Kotlin with a few functional interfaces written in Java, and it runs on the Eclipse Jetty web server. The JSON mapper is pluggable, so Javalin supports any and all JSON-mapping libraries. There is an optional Jackson implementation included, but you can also choose to create your own mapper.

javalin2

The recent release has a wide range of improvements, starting with the addition of ETag support and a method for auto-generating ETags. Entity Tags are HTTP headers that are used to validate Web caches, and to cache unchanged resources.

Support has been added for WebJars client-side web libraries. These are client-side libraries such as jQuery and Bootstrap packaged into Java Archive (JAR) files. The libraries can then be used to manage the client-side dependencies in JVM-based web applications.

The JSON and template support in Javalin has been modularized in this release making it possible to plug in your own choice of rendering engines and mappers. More generally, template functionality has been moved to a single function that uses the correct engine based on the file extension.

A new CRUDhandler has been added that implements the five most common crud operations (create, read all, read one, update, delete). The new handler is designed to remove boilerplate code when creating standard CRUD APIs.

The new release has better support for single-page applications, and better exception handling for async requests.

The WebSocket implementation and the test suite have been re-written, and an implementation of the Pac4 security library has been included.

The developers say there are also a lot quality of life improvements, such as functions returning List instead of Array, returning empty collections instead of null, better default values and package structure, and fixing visibility from Java.

javalin

More Information

Javalin Webpage

Related Articles

Serialization Will Go From Java - Sometime

Kotlin 1.2 Released With Cross Platform Support

The Programmers Guide To Kotlin - Type

Android Programming In Java - Android Events 

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Blender 4.5 Adds Full Vulkan Support
29/07/2025

Blender 4.5 is now available with a wide ranging set of improvements including full support for Vulkan, a more flexible compositor, and enhancements to the animation timeline.`



Node.js Adds Default Type Stripping
21/08/2025

The latest update to Node.js adds type stripping by default, along with other more minor improvements including the propagation of permission model flags on spawn; and a fix to allow correct handling  [ ... ]


More News

pico book

 

Comments




or email your comment to: comments@i-programmer.info