示例#1
0
 @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();
 }
示例#2
0
 @Override
 public void preHandle(RoutingContext context) {
   context.data().put(PaginationContext.DATA_ATTR, PaginationContext.fromContext(context));
   context.next();
 }