Javalin 2.0 supports WebJars web libraries, JSON modularization Matthew Kerslake

Javalin 2.0 supports WebJars web libraries, JSON modularization

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.

IDG Insider

PREVIOUS ARTICLE

« Samsung Galaxy Note 9 review: The best never felt so bland

NEXT ARTICLE

Windows 95 is now downloadable as a nostalgic 'app' »
author_image
IDG Connect

IDG Connect tackles the tech stories that matter to you

  • Mail

Recommended for You

Tech Cynic: VR, the never-popular technology

Tech Cynic – IT without the rose-tinted spectacles

Five months on, GDPR doubts remain for this lawyer

Martin Veitch's inside track on today’s tech trends

How can smart solutions help address Southeast Asia's urban challenges?

Keri Allan looks at the latest trends and technologies

Poll

Is your organization fully GDPR compliant?