HackerTrans
TopNewTrendsCommentsPastAskShowJobs

breakpete

no profile record

comments

breakpete
·2 jaar geleden·discuss
Not sure about the older versions of Javalin, but from my experience with v5+ it just uses regular Single Abstract Method conversion for the Handler interface, which has a single method with just one parameter (the Context).
breakpete
·2 jaar geleden·discuss
Regarding 2, you can actually bind routes to instance methods:

  var obj = new SomeObjectWithHandlerMethods(dependency);
  var app = Javalin.create().get("/", obj::handlerMethod).start();

Edit: For 4, Javalin 6 also has some documentation regarding Servlets here: https://javalin.io/documentation#adding-other-servlets-and-f...