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


Pi Day - The Great Unanswered Questions
14/03/2024

It's Pi day again, again, again... Even after so many, I still have things to say about this most intriguing number. The most important things about Pi is that it is irrational and one of the few tran [ ... ]



Visual Studio 17.9 Now Generally Available
18/03/2024

Visual Studio 17.9 is now fully available with AI assistance and better extensibility. The first preview of 17.10 has also been made available in preview.


More News

raspberry pi books

 

Comments




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