Skip to content

Mistake in documentation at jooby.io? #3696

@hofrichter

Description

@hofrichter

At jooby.io you can find an wrong or outdated(?) example:

1.3. MVC API:

import io.jooby.annotation.*;

public class MyController {

  @GET
  public String sayHi() {
    return "Hello Jooby!";
  }
}

public class App {

  public static void main(String[] args) {
    runApp(args, app -> {

      app.use(new MyController()); // <<<<<< wrong!

    });
  }
}

Compared to 5.2. Registration the correct way is using the generated code by jooby-apt:

public class App extends Jooby {
  {
    mvc(new MyController_()); // <<<<< right, underscore-suffix in the classname
  }

  public static void main(String[] args) {
    runApp(args, App::new);
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions