Skip to content

Instantly share code, notes, and snippets.

@danbev
Last active December 11, 2015 05:58
Show Gist options
  • Save danbev/4555903 to your computer and use it in GitHub Desktop.
Save danbev/4555903 to your computer and use it in GitHub Desktop.
Paging in Route Configuration
final RoutingModule routingModule = new AbstractRoutingModule() {
    @Override
    public void configuration() {
      route()
            .from("/cars")
            .on(RequestMethod.GET)
            .produces(MediaType.JSON, CustomMediaTypeResponder.MEDIA_TYPE)
            .paged().totalCallback("getCarsTotal").headersPrefix("CompayName-")
            .to(Cars.class).findCarsByBrand(param("offset", "0"), param("limit", "10"));
    }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment