days
0
-9
hours
0
-1
minutes
-2
-6
seconds
-3
-7
search
What's new and noteworthy

Javalin 2.8.0 arrives with Micrometer support and important Misc fixes

Eirini-Eleni Papadopoulou
Java
© Shutterstock / ESB Professional

Javalin, with its super fast release cycle, is back with a new update that brings some important fixes as well as some handy new features. Let’s take a look.

If you are not yet familiar with Javalin, a short introduction is in order.

Javalin is a potent yet lightweight mixture of Java and Kotlin. With a focus on simplicity and interoperability, Javalin is perfect for developers who need a flexible and lightweight framework for developing.

This time around, we take a look at Javalin 2.8.0 which brings some important fixes, as well as Validation improvements, and Micrometer support.

Let’s have a look.

The updates

Validation improvements – The validation added in 2.2.0 is one of Javalin’s most popular features. However, the syntax was a bit rickety. More specifically, the naming of the validation methods make the code overly verbose, and everything looks very inconsistent. In 2.8.0, ctx.validated...  gets deprecated and overloads are introduced instead. This should make controllers a lot easier to read. The methods will be removed completely in 3.0.0.

Micrometer support – This vendor-neutral application metrics facade is now supported in Javalin and you can easily enable it by doing app.enableMicrometer().

Simplified startup logging – This might seem like a minor thing, but there have been some complaints from the users about verbose and cryptic log messages from Jetty. The Javalin team agrees that those messages weren’t that helpful so they removed them.

Misc fixes – There are several important fixes including:

  • CORS now supports cookies (allow-credentials: true)
  • You can now use any connector (such as UnixSocketConnector) with the embedded Jetty server
  • Jetty no longer retries a request if a java.lang.Error is thrown in a handler
  • Javalin used to log.error(...) if it failed to start, now it throws instead
  • sessionHandler() no longer throws exceptions if SessionHandler looks misconfigured

Head over to the official release notes to find out more information on these updates.

SEE ALSO: Kotlin and Java go well together, report shows

Getting started

Want to try out Javalin 2.6 for yourself? This open source web framework is available on GitHub or here for download. Javalin is a true micro Java REST API library and has no external dependencies other than the embedded web-server, but it has plugins for JSON mapping and template rendering available if you need them.

Author
Eirini-Eleni Papadopoulou
Eirini-Eleni Papadopoulou is an editor for JAXenter.com. Just finished her masters in Modern East Asian Studies and plans to continue with her old hobby that is computer science.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of