@Override public void postHandle(RoutingContext context) { PaginationContext pageContext = (PaginationContext) context.data().get(PaginationContext.DATA_ATTR); String linkHeader = pageContext.buildLinkHeader(context.request()); if (linkHeader != null) { context.response().headers().add(HttpHeaders.LINK, linkHeader); } else { log.warn("You did not set the total count on PaginationContext, response won't be paginated"); } context.next(); }
@Override public void preHandle(RoutingContext context) { context.data().put(PaginationContext.DATA_ATTR, PaginationContext.fromContext(context)); context.next(); }