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

LEAVE A REPLY

Please enter your comment!
Please enter your name here