Jooby

Upgrading from 3.x to 4.x

You will find here notes/tips about how to migrate from 3.x to 4.x.

Note

This is a work in progress document, if something is wrong or missing please report to Github or better edit this file and fix it

Requirements

  • Java 21 as minimum

Special HTTP names

Starting from 4.0.7 @XXXParam the default annotation value attribute is actually that: the default value of the parameter. In previous version this was used it for invalid/special HTTP names.

In 3.x:

@QuerParam("some-http-name") String name

In 4.x

@QuerParam(name = "some-http-name") String name

The value is now reserved for default values:

@QueryParam("20") int pageSize

Buffer API

The package io.jooby.buffer is gone. It was replaced by io.jooby.output these classes are used mainly by the MessageEncoder API, the new API is easier to use and has better performance.

Value API

The new package is now io.jooby.value. The API is now decoupled from Context in future release will be the basis of a new configuration system.

Also, the io.jooby.ValueNode and io.jooby.ValueNodeConverter are gone.

Session API

For security reasons, the default HTTP session was removed. You need to configure the session explicitly and provide a cookie session name. The jooby.sid cookie name was removed from project.

Server configuration

The install(Server), setServerOptions, start() method are gone. With the new support for multiple applications in a single server, these methods are useless.

The new way:

New way to boot
runApp(args, new NettyServer(new ServerOptions()), App::new);

Packages

3.x

4.x

Module

io.jooby.buffer

io.jooby.output

replacement jooby (core)

Classes

3.x

4.x

Module

Description

io.jooby.buffer.*

-

jooby (core)

removed

io.jooby.output.*

jooby (core)

new output API

io.jooby.MvcFactory

-

jooby (core)

was deprecated and now removed

io.jooby.annotation.ResultType

-

jooby (core)

removed

io.jooby.ValueNode

io.jooby.value.Value

jooby (core)

replaced/merged

io.jooby.ValueNodeConverter

io.jooby.value.ValueConverter

jooby (core)

replaced/merged

io.jooby.RouteSet

io.jooby.Route.Set

jooby (core)

moved into Route and renamed to Set

Method

3.x

4.x

Description

io.jooby.Jooby.setServerOptions()

Server.setOptions()

removed in favor of Server.setOptions()

io.jooby.Router.mvc

-

it was deprecated and now removed

io.jooby.Router.decorator

-

it was deprecated and now removed

io.jooby.Router.getConverters

io.jooby.Router.getValueFactory

replaced

io.jooby.Router.getBeanConverters

io.jooby.Router.getValueFactory

replaced

io.jooby.Router.attribute(String)

Router.getAttribute(String)

Renamed

io.jooby.Router.RouteOption

io.jooby.RouterOptions

Moved to RouterOptions

io.jooby.Router.setTrustProxy

RouterOptions.setTrustProxy

Moved to RouterOptions