code: private void handlePaginationRequest(final Request request) {
  		String rowsStr = request.getParameter(getId() + ".rows");
  
  		int prevPage = getCurrentPage();
  		int prevRows = getRowsPerPage();
  
  		boolean rowsChanged = false;
  
  		// Check for rows per page option and is valid
  		if (rowsStr != null && getRowsPerPageOptions() != null) {
  			try {
  				int newRows = Integer.parseInt(rowsStr);
  				// If rows option changed
  				if (prevRows != newRows) {
  					// Set rows
  					setRowsPerPage(newRows);
  					if (newRows == 0) {
  						setCurrentPage(0);
  					} else {
  						// Try to calc the page the previous top row was on
  						int startIdx = prevPage * prevRows;
  						int page = startIdx / newRows;
  						setCurrentPage(page);
  					}
  					rowsChanged = true;
  				}
  			} catch (NumberFormatException e) {
  				LOG.warn("Invalid rows option: " + rowsStr);
  			}
  		}
  
  		// Check for the current page
  		if (!rowsChanged && isPaginated()) {
  			String pageStr = request.getParameter(getId() + ".page");
  			if (pageStr == null) {
  				setCurrentPage(0);
  			} else {
  				try {
  					int pageNum = Integer.parseInt(pageStr);
  					setCurrentPage(pageNum);
  				} catch (NumberFormatException e) {
  					LOG.warn("Invalid page number: " + pageStr);
  				}
  			}
  		}
  
  	}
docs: Handles a request containing pagination data.
  
  @param request the request containing a pagination data.