Important: This news article covers an old version of Javalin (v1.3.0). The current version is v6.4.0.
See the documentation page for up-to-date information.

WebSocket improvements

  • Jetty WebSocket module is now bundled with Javalin, there is no need to add it separately. If your project already has the WebSocket dependency declared this can now be removed.
  • Each WsSession now has an ID that you can access via session.id

Multiple Static Files locations

You can now call enableStaticFiles as many times as you want. Each call will add a new handler:

val app = Javalin.create().apply {
    enableStaticFiles("/public/a")
    enableStaticFiles("/public/b")
    enableStaticFiles("src/test/external/", Location.EXTERNAL)
}.start()

Handlers will be executed in the order they’re declared.