Maven:
<dependency>
<groupId>io.javalin</groupId>
<artifactId>javalin</artifactId>
<version>2.0.0.RC3</version>
</dependency>
Gradle:
compile 'io.javalin:javalin:2.0.0.RC3'
Changelog (git log): https://github.com/tipsy/javalin/compare/f265048dac52112b8c89ad891035acb710bc31b2...HEAD
Javalin 2 has some changes to the package structure:
io.javalin.embeddedserver.jetty.websocket -> io.javalin.websocketio.javalin.embeddedserver.Location -> io.javalin.staticfiles.Locationio.javalin.translator.json.JavalinJsonPlugin -> io.javalin.json.JavalinJsonio.javalin.translator.json.JavalinJacksonPlugin -> io.javalin.json.JavalinJacksonio.javalin.translator.template.JavalinXyzPlugin -> io.javalin.rendering.JavalinXyzio.javalin.security.Role.roles -> io.javalin.security.SecurityUtil.rolesio.javalin.ApiBuilder -> io.javalin.apibuilder.ApiBuilderio.javalin.ApiBuilder.EndpointGrooup -> io.javalin.apibuilder.EndpointGrooupapp.embeddedServer(new EmbeddedJettyFactory(() -> new Server())) // v1
app.server(() -> new Server()) // v2
Javalin.start(port) has been removed. Javalin.create().start(0); is now required.disableDynamicGzip()LowResourceMonitor attached by defaultdefaultCharset() method has been removed/path and /Path as the same URL.app.enableCaseSensitiveUrls().It was possible to defined WebSockets using Jetty annotations in v1 of Javalin.
These Jetty WebSockets have limited functionality compared to the Javalin lambda WebSockets,
which is why they have been removed.
Set instead of ListCookieBuilder class has been removed, use Cookie directly.ctx.uri() has been removed, it was a duplicate of ctx.path()Array<T> now return List<T>ctx.param() is now ctx.pathParam()ctx.xyzOrDefault("key") methods have been change into ctx.xyz("key", "default")ctx.next() has been removedctx.body<MyClass>() to deserialize jsonctx.request() is now ctx.reqctx.response() is now ctx.resctx.renderXyz methods are now just ctx.render() (correct engine is chosen based on extension)ctx.charset(charset) has been removedEvent as an argument (they now take nothing)io.javalin.event.EventType is now io.javalin.JavalinEvent HaltException has been removed and replaced with HttpResponseException. Some common responses are included:@sureshg reports "(http(s), http/2 , websockets + jdk 10)" working as expected with 2.0.0.RC1.
I've also ported every project I have, as well as every tutorial (~20 projects all together), and haven't experienced any issues.
Edit: I deleted two conversations, one about Selenium and one aout JSON mapping, because they were not related to v2.0.
Most helpful comment
I've also ported every project I have, as well as every tutorial (~20 projects all together), and haven't experienced any issues.
Edit: I deleted two conversations, one about Selenium and one aout JSON mapping, because they were not related to v2.0.