News

Javalin 2.0.0 is now stable

2 min read

Earlier this month, the launch of Javalin 2.0 RC3 was announced. The team has now removed the “RC” tag and made Javalin 2.0.0 stable. Javalin is a web framework for Kotlin and Java, which is simple, lightweight, interoperable, and flexible.

With ~5000 additions and ~5500 deletions reflecting in the gitlog, major changes have been introduced in this version. Most of the changes include the removal of abstraction layers and the completely rewritten implementation of WebSocket and test-suite.

To summarize, here are few of the major changes:

Additions

  • ETag support and a method for auto-generating ETags
  • Support for WebJars, client-side web libraries packaged into JAR (Java Archive) files.
  • Javalin now has a pac4j implementation. It is an security library for Javalin web applications which supports authentication and authorization.
  • RequestLogger interface ({ ctx, executionTime -> …})
  • An option to return 405 instead of 404, listing available methods for the path
  • A set of default responses, so you can throw BadRequestResponse()
  • A CrudHandler to remove some boilerplate from creating standard CRUD APIs

Improvements

  • Improved support for Single Page Applications
  • Improved exception handling for async requests
  • You can now easily plug in your own mappers/rendering engines, as JSON and Template functionalities has been modularized. The ctx.render() function now contains all the Template functionality.

Default value changes

  • All requests run through an AccessManager now with the default implementation, NOOP
  • URL matching is now case-insensitive by default. You can call app.enableCaseSensitiveUrls() if you want to disable it.
  • Request-caching is now limited to 4kb
  • Server now has a LowResourceMonitor attached

To know more on the Javalin 2.0.0 updates head over to their official website. If you are planning to migrate from 1.x to 2.x, you can refer to the migration guide.

Read Next

Javalin 2.0 RC3 released with major updates!

Kotlin 1.3 M1 arrives with coroutines, new experimental features like unsigned integer types

Kotlin/Native 0.8 recently released with safer concurrent programming

Bhagyashree R

Share
Published by
Bhagyashree R

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago