diff --git a/documentation/src/main/asciidoc/introduction/Introduction.adoc b/documentation/src/main/asciidoc/introduction/Introduction.adoc index d7d33e0978..861aa5023c 100644 --- a/documentation/src/main/asciidoc/introduction/Introduction.adoc +++ b/documentation/src/main/asciidoc/introduction/Introduction.adoc @@ -533,8 +533,8 @@ Whatever the case, the code which orchestrates a unit of work usually just calls [source,java] ---- @GET -@Path("books/{titlePattern}") -public List findBooks(String titlePattern) { +@Path("books/{titlePattern}/{page:\\d+}") +public List findBooks(String titlePattern, int page) { var books = sessionFactory.fromTransaction(session -> Queries.findBooksByTitleWithPagination(session, titlePattern, Page.page(RESULTS_PER_PAGE, page)); @@ -565,8 +565,8 @@ We can call it just like we called our handwritten version: [source,java] ---- @GET -@Path("books/{titlePattern}") -public List findBooks(String titlePattern) { +@Path("books/{titlePattern}/{page:\\d+}") +public List findBooks(String titlePattern, int page) { var books = sessionFactory.fromTransaction(session -> Queries_.findBooksByTitleWithPagination(session, titlePattern, Page.page(RESULTS_PER_PAGE, page));