Hacker News new | ask | show | jobs
by Zekio 3306 days ago
how is this different from Spark Java aside from the name that is
2 comments

I should probably create a comparison chart, but in short:

Javalin has no static API, and no concept of "Routes and Filters". In spark Routes have a return value, in Javalin you just have "Handlers" which operate on the request and response. Javalin can do automatic object-mapping to and from json, and has lifecycle events.

Javalin has a built in mechanism for auth (AccessManager)

Javalin has no WebSocket support, and doesn't do static file handling (it leaves this to the embedded server). Javalin runs before-handlers before static files, Spark does not.

Javalin has a fluent api.

Javalin is implemented as a servlet, not a filter.

After-handlers are run after everything (even in case of exceptions), (Spark has after-after filters).

There are many more small differences. I'm one of the maintainers of Sparkjava. Javalin is the result of using Spark daily for the past two years, fixing minor annoyances and including new concepts I would find myself implementing over and over again.

It looks like express so it's got to be hip.