Paul Krill
Editor at Large

Javalin 2.0 supports WebJars web libraries, JSON modularization

news
Aug 24, 20182 mins

Javalin 2.0 provides interoperability between Java and Kotlin

time / clock / history / coffee / java
Credit: Matthew Kerslake

Version 2.0 of Javalin, a lightweight framework for the Java and Kotlin languages, is now shipping.

Supporting HTTP/2 and async requests, Javalin 2.0 provides interoperability between Java and Kotlin and is intended to be simple to use.

Changes made since the Version 1.7 release in May include:

  • Support for WebJars client-side web libraries.
  • Modularization of JSON and template functionality, so developers can plug in their own mappers/rendering engines.
  • The addition of a CRUDhandler to remove boilerplate from creating standard CRUD (create, read, update, delete) APIs.
  • Improved support for single-page applications.
  • Better exception handling for async requests.
  • The Pac4 security library.
  • Template functionality has been moved to a single ctx.render() function that uses the correct engine, based on file extension.
  • Rewritten WebSocket implementation.
  • Rewritten test suite.
  • A RequestLogger interface has been added.
  • Default values have been changed in some instances.
  • Functions return list instead of array.
  • Empty collections are returned instead of null.

Rather than being a full web framework, Javalin is a lightweight REST API library, or microframework. Although Javalin has no concept of MVC, its support of WebSockets, template engines, and static file-serving lets Javalin be used for building a RESTful API back end and serving index.html with static resources, if a developer is building a single-page application. To build a more traditional website, template engine wrappers can be used. The framework began as a fork of the Spark framework for Java and Kotlin but was rewritten, influenced by the Koa.js web framework.

Where to download Javalin

You can download Javalin from the project’s download page.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author