Groovy Documentation

org.devnull.util.pagination
[Groovy] Class HttpRequestPagination

java.lang.Object
  org.devnull.util.pagination.SimplePagination
      org.devnull.util.pagination.HttpRequestPagination

class HttpRequestPagination
extends SimplePagination

Helps bind http request parameters to pagination fields. See the PARAM constants.


Property Summary
static java.lang.String PARAM_DIRECTION

static java.lang.String PARAM_MAX

static java.lang.String PARAM_PAGE

static java.lang.String PARAM_SORT

 
Constructor Summary
HttpRequestPagination(javax.servlet.http.HttpServletRequest request)

 
Method Summary
static java.util.List parseSortParams(javax.servlet.http.HttpServletRequest request)

Uses request parameters {@value PARAM_SORT} and {@value PARAM_DIRECTION} to build Sort criteria.

 
Methods inherited from class java.lang.Object
java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long)
 

Property Detail

PARAM_DIRECTION

static final java.lang.String PARAM_DIRECTION


PARAM_MAX

static final java.lang.String PARAM_MAX


PARAM_PAGE

static final java.lang.String PARAM_PAGE


PARAM_SORT

static final java.lang.String PARAM_SORT


 
Constructor Detail

HttpRequestPagination

HttpRequestPagination(javax.servlet.http.HttpServletRequest request)


 
Method Detail

parseSortParams

static java.util.List parseSortParams(javax.servlet.http.HttpServletRequest request)
Uses request parameters {
value:
PARAM_SORT} and {@value PARAM_DIRECTION} to build Sort criteria. Examples: ?{@value PARAM_SORT}=lastName&{@value PARAM_DIRECTION}=DESC Sort(field: "lastName", direction: "DESC") ?{@value PARAM_SORT}=lastName&?{@value PARAM_DIRECTION}=age&{@value PARAM_DIRECTION}=DESC [Sort(field: "lastName", direction: "DESC"), Sort(field: "age", direction: "DESC")] You can scope directions to fields by appending the direction after the field value. For instance: ?{@value PARAM_SORT}=lastName&?{@value PARAM_DIRECTION}=age&{@value PARAM_DIRECTION}=DESC&age.{@value PARAM_DIRECTION}=ASC [Sort(field: "lastName", direction: "DESC"), Sort(field: "age", direction: "ASC")]


 

Groovy Documentation