App extensions and single-page improvements ( Jan 4, 2019 )

What's Javalin? Javalin is a very lightweight Java and Kotlin web framework which focuses on simplicity and Java/Kotlin interoperability. Read more on our landing page

App extensions

You can now create app-extensions by calling app.register(appExtension) . The Extension interface is a simple lambda with access to the current Javalin app:

Javalin . create () . register ( app -> { ... }) // register lambda . register ( new ExtensionClass (...)); // ExtensionClass must implement Extension

You can (for example) create a DosFilter that you use across multiple Javalin apps, and add it to each app by calling app.register(new DosFilter()) .

The feature is inspired by the register function in Sinatra: http://sinatrarb.com/extensions.html

Single-page mode improvements

You can now use external (non classpath) files for your single-page entrypoint ( index.html )

) Single-page entry point ( index.html ) is no longer cached if host is localhost

Bugfixes and misc