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, FacebookGoogle+ or Linkedin.

Banner


Linux Adopts New Code of Conduct; Linus Apologizes and Takes a Break
17/09/2018

Linus Torvalds is taking a break from his role as chief Linux maintainer. This isn't because he wants to stop Linux kernel development, but because he wants help on how to behave differently - more in [ ... ]



MS-DOS Source Code on GitHub
09/10/2018

MS-DOS v1.25 and v2.0 are both now available on GitHub for anyone to fork - either for historical purposes or for practical application.


More News

Python

 



 

Comments




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